[TriLUG] OT: bash scripting question

Chris Knowles chrisk at trilug.org
Wed Jun 25 09:18:31 EDT 2003


date -d "yesterday" works for me.

CJK
On Wed, 2003-06-25 at 09:00, Greg Brown wrote:
> I need an easy way to figure out the date for "yesterday" in a script.  
> This is easy enough to do with Perl but I can't use Perl for this 
> script.
> 
> To get the seconds from Jan 1, 1970 I use the following command:
> 
> date +%s
> 
> I can then do some math to the output (subtracting (24 * 60 * 60)) to 
> return yesterday's date but is there an easy way to translate the 
> corresponding string of seconds back to a human readable date?  The 
> date command doesn't seen to do this for me, at least not that I can 
> see.
> 
> Greg
> 
> _______________________________________________
> TriLUG mailing list
>     http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ:
>     http://www.trilug.org/faq/TriLUG-faq.html
-- 
Chris Knowles <chrisk at trilug.org>



More information about the TriLUG mailing list