Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to grep for a previous day

Status
Not open for further replies.

chanman525

IS-IT--Management
Oct 7, 2003
169
US
Probably a simple solution but I can't find any documentation on it.

I'm trying grep for a previous day using date ="%a %h %d" format. It displays Thu Mar 15.

All I need to do is go back one day. Can anyone put me in the right direction?
 
Code:
perl -MPOSIX -e 'print POSIX::strftime("%a %h %d",
                             localtime(time - (3600*24)))'

Will give you yesterday's date in the form you want.

- Rod



IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

Wish you could view posts with a fixed font? Got Firefox & Greasemonkey? Give yourself the option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top