[ale] Bash script help

Jim Kinney jim.kinney at gmail.com
Wed Mar 12 09:04:14 EDT 2008


On Wed, Mar 12, 2008 at 5:50 AM, Doctor Who <whodoctor at gmail.com> wrote:

> I'm trying to return the value of when the last time the root password
> was changed.  The script would do something like:
>
> 1) more /etc/shadow | grep root | awk -F: '{print $3}'


at this point you have  days since Jan 1, 1970 password was last changed. If
you have put this into a variable, you off to the races

>
> 2) Take above value and add 1

shell math. refer to
http://www.ale.org/archive/ale/ale-1997-11/msg00160.html

>
> 3) Multiple the result by 86400

see above

>
> 4) Substitute the value above after the @ below

use your now modified variable

>
> 5) date -d @XXXX +"%B %d %G"
> 6) Give me the output value of this
>
> I would like to keep this done using bash.  Any help appreciated.


Basically you just string these things along saving the parts as needed in a
variable.

>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
>



-- 
-- 
James P. Kinney III
CEO & Director of Engineering
Local Net Solutions,LLC
http://www.localnetsolutions.com

GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)
<jkinney at localnetsolutions.com>
Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.ale.org/pipermail/ale/attachments/20080312/0a538506/attachment.html 


More information about the Ale mailing list