[ale] Bash script help

Mike Fletcher fletch at phydeaux.org
Wed Mar 12 15:44:58 EDT 2008


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




More information about the Ale mailing list