Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.misc > #7961
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | "Chris F.A. Johnson" <cfajohnson@gmail.com> |
| Newsgroups | comp.os.linux.misc |
| Subject | Re: Extract "Last checked" from extX filesystem |
| Date | Tue, 23 Apr 2013 03:31:20 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 34 |
| Message-ID | <8vph4a-vdb.ln1@cfa.johnson> (permalink) |
| References | <lqli8a8eyh.fsf@pia.msmri.medicine.ubc.ca> <slrnknbcg7.f7u.BitTwister@wb.home.test> <r4pg4a-t83.ln1@cfa.johnson> <slrnknbeup.j1r.BitTwister@wb.home.test> |
| Reply-To | cfajohnson@gmail.com |
| Injection-Info | mx05.eternal-september.org; posting-host="869c09daa1f7c33cd503aabdab6629b7"; logging-data="9528"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+heQSIa7EF3REq5zGk2vuSomG6pxjgk/8=" |
| User-Agent | slrn/0.9.8.1 (Linux) |
| Cancel-Lock | sha1:g8S7UBx5N/VeVDyhBoQ0F4LO1FU= |
| Xref | csiph.com comp.os.linux.misc:7961 |
Show key headers only | View raw
On 2013-04-22, Bit Twister wrote:
> On Mon, 22 Apr 2013 18:11:07 -0400, Chris F.A. Johnson wrote:
>> On 2013-04-22, Bit Twister wrote:
>
>>> You could try something like
>>> set $(dumpe2fs -h /dev/sdb5 | grep 'Last checked')
>>> shift 3
>>> _date="$@"
>>> _epoch=$(date --date="$date" +%s)
>
> Oops, _epoch=$(date --date="$_date" +%s)
>
>>>
>>> echo "$_date is $_epoch"
>>
>> Or:
>>
>> read -a x < <(sudo dumpe2fs -h /dev/sdb6 2>/dev/null | grep 'Last checked:')
>> echo "${x[@]:3}"
>
> Op wanted epoch seconds. Is there any way to insert the "${x[@]:3}"
> in place of my $_date variable?
>
> _epoch=$(date --date="$_date" +%s)
read last checked dow m d t y < <(sudo dumpe2fs -h /dev/sdb6 2>/dev/null | grep 'Last checked:')
epoch_seconds=$( date -d "$d $m $y $t" +%s )
--
Chris F.A. Johnson, <http://cfajohnson.com>
Author:
Pro Bash Programming: Scripting the GNU/Linux Shell (2009, Apress)
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Back to comp.os.linux.misc | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Extract "Last checked" from extX filesystem Vilmos Soti <vilmos@soti.ca> - 2013-04-22 13:53 -0700
Re: Extract "Last checked" from extX filesystem Bit Twister <BitTwister@mouse-potato.com> - 2013-04-22 21:53 +0000
Re: Extract "Last checked" from extX filesystem "Chris F.A. Johnson" <cfajohnson@gmail.com> - 2013-04-22 18:11 -0400
Re: Extract "Last checked" from extX filesystem Bit Twister <BitTwister@mouse-potato.com> - 2013-04-22 22:35 +0000
Re: Extract "Last checked" from extX filesystem "Chris F.A. Johnson" <cfajohnson@gmail.com> - 2013-04-23 03:31 -0400
Re: Extract "Last checked" from extX filesystem gazelle@shell.xmission.com (Kenny McCormack) - 2013-04-23 08:29 +0000
Re: Extract "Last checked" from extX filesystem Bit Twister <BitTwister@mouse-potato.com> - 2013-04-23 12:19 +0000
Re: Extract "Last checked" from extX filesystem Bit Twister <BitTwister@mouse-potato.com> - 2013-04-23 12:01 +0000
Re: Extract "Last checked" from extX filesystem J G Miller <miller@yoyo.ORG> - 2013-04-22 21:55 +0000
Re: Extract "Last checked" from extX filesystem Richard Kettlewell <rjk@greenend.org.uk> - 2013-04-23 18:55 +0100
Re: Extract "Last checked" from extX filesystem J G Miller <miller@yoyo.ORG> - 2013-04-23 19:23 +0000
Re: Extract "Last checked" from extX filesystem Robert Riches <spamtrap42@jacob21819.net> - 2013-04-24 04:18 +0000
Re: Extract "Last checked" from extX filesystem Richard Kettlewell <rjk@greenend.org.uk> - 2013-04-24 08:53 +0100
Re: Extract "Last checked" from extX filesystem Vilmos Soti <vilmos@soti.ca> - 2013-04-23 13:21 -0700
Re: Extract "Last checked" from extX filesystem Bit Twister <BitTwister@mouse-potato.com> - 2013-04-23 21:25 +0000
Re: Extract "Last checked" from extX filesystem Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2013-04-25 16:33 +0200
csiph-web