Jeff Dean on Mon, 25 Mar 2002 20:50:19 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Shell script quickie: yesterday's date


How about:

  date +%Y%m%d -d '-1 day'

jd

Quoting "Michael F. Robbins" <mike@gamerack.com>:

> For you shell scripting wizards out there...  I need a script that
> will
> simply echo yesterday's date.  This should be according to local time,
> not GMT.  For example, if run today, it should simply echo "20020324".
> 
> I've been playing with the 'date' command, and `date +%Y%m%d` gives
> exactly what I want, except with today's date.  I think the '-d'
> option
> is useful, but I'm not sure what the argument should be. 
> 
> Ah, it feels good to be back on PLUG, with my mail server now running
> debian...  Goodbye, rpm dependencies! 
> 
> Michael F. Robbins 
> mike@gamerack.com
> 
> 

______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug