<br><br><div class="gmail_quote">On Wed, Mar 12, 2008 at 5:50 AM, Doctor Who <<a href="mailto:whodoctor@gmail.com">whodoctor@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I'm trying to return the value of when the last time the root password<br>
was changed. The script would do something like:<br>
<br>
1) more /etc/shadow | grep root | awk -F: '{print $3}'</blockquote><div><br>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<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
2) Take above value and add 1</blockquote><div>shell math. refer to <a href="http://www.ale.org/archive/ale/ale-1997-11/msg00160.html">http://www.ale.org/archive/ale/ale-1997-11/msg00160.html</a><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
3) Multiple the result by 86400</blockquote><div>see above <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
4) Substitute the value above after the @ below</blockquote><div>use your now modified variable <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
5) date -d @XXXX +"%B %d %G"<br>
6) Give me the output value of this<br>
<br>
I would like to keep this done using bash. Any help appreciated.</blockquote><div><br>Basically you just string these things along saving the parts as needed in a variable. <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
_______________________________________________<br>
Ale mailing list<br>
<a href="mailto:Ale@ale.org">Ale@ale.org</a><br>
<a href="http://mail.ale.org/mailman/listinfo/ale" target="_blank">http://mail.ale.org/mailman/listinfo/ale</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>-- <br>James P. Kinney III <br>CEO & Director of Engineering <br>Local Net Solutions,LLC <br><a href="http://www.localnetsolutions.com">http://www.localnetsolutions.com</a><br>
<br>GPG ID: 829C6CA7 James P. Kinney III (M.S. Physics)<br><<a href="mailto:jkinney@localnetsolutions.com">jkinney@localnetsolutions.com</a>><br>Fingerprint = 3C9E 6366 54FC A3FE BA4D 0659 6190 ADC3 829C 6CA7