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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

date command in a script

Status
Not open for further replies.

abovebrd

IS-IT--Management
May 9, 2000
690
US
I need to add two entires to a data file. These entires are the present date and (the date that would be two weeks back from the present date)

In other words

todays date - 14 days
If todays date was 1/3/01
The second date would need to be 12/20/00

These entries get appened to a file.
I figured out how to create the first date.
date +%D > date.new

Any ideas on how to create the second date ?

-Danny






 
Take a look in the Sun:Solaris Forum for a thread called "Shell Script to Get Previous Day". Hopefully it will help you out a bit.

Hope this helps,
Paul
 
pmkincaid I need to buy you a beer.

Man ! thats just what I needed.

Thanks

-Danny

-Danny






 
upon further inspection that link does not help me.

I need the date specified as 01/03/01



-Danny






 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top