> Lawson> If you have Perl-5 installed, then you can use:
> Lawson> #!/bin/sh
> Lawson> #
> Lawson> # Program: yesterday
> Lawson> # Author: Randall Schwartz
> Lawson> # Purpose: Prints yesterday's date
> Lawson> #
> Lawson> perl -e 'printf "%s\n", scalar localtime (time - 86400)'
> Ouch. That hurts, unless you're talking about some other Randall [sic]
> Schwartz.
> My version was merely:
> perl -e 'print scalar localtime (time - 86400)'
> No need to make the trip into printf land. (My friends would be so
> embarassed for me if they thought I wrote code like that. :-)
> Just another Perl hacker,
While perl is wonderful tool,
it's a sledgehammer approach to this problem.
Use GNU date:
/opt/local/gnu/bin/date --date '2 days ago'
And it almost looks like it was written by a human being ;)
Assuming of course (like perl) you have it on your system!
In UNIX, there is always one more way to defer a feline ;)
(not a useless use of cat)
sorry ;)
rachel
--
Rachel Polanskis Kingswood, Greater Western Sydney, Australia
Witty comment revoked due to funding cuts