[ale] Bash script help

Doctor Who whodoctor at gmail.com
Wed Mar 12 17:08:33 EDT 2008


On 3/12/08, Mike Fletcher <fletch at phydeaux.org> wrote:
> Geoffrey wrote:
> > Greg Freemyer wrote:
> >
> >> Now the poor student has to simplify that down to something the
> >> teacher will believe he wrote.
> >>
> >> May be easier just to do it from the other helpful hints.
> >>
> >
> > I thought that was simpler.  I broke that down from the one liner:
> >
> > date -d @$(awk -F ':' '/root/ {print ($3 + 1) * 86400 }' /etc/shadow) \
> > +"%B %d %G
> >
> >
> Fore!
>
> perl -MPOSIX -F: -lane '/^root:/&&print strftime("%B %d
> %G",localtime(($F[2]+1)*86400))' /etc/shadow
>
> ruby -F: -lane 'if/^root:/;puts
> Time.at(($F[2].to_i+1)*86400).strftime("%B %d %G");end' /etc/shadow
>
>
>

Thanks again for all the input...not that it matters, I guess, but to
put everyone's mind at ease this was not 'homework.'  I stopped that
quite a ways back.  Someone asked me for help with this (also not
homework) and I knew how to get most of the way there, but my bash
kung-fu is not that strong and I needed a little help.

I learned a good bit thanks to some of the replies.  Thanks again!


More information about the Ale mailing list