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!

Add date to filename

Status
Not open for further replies.

beaster

Technical User
Aug 20, 2001
225
US
I forget how to add a date/timestamp to a the file I am creating in a script....Can someone help me?

Like:

tod=

then I am gonna

cp current_file new_alarms-$date

also I want to ftp only the newest file over to my nt machine inside the script. I have the ftp working, But need to know how to pick up the newest file to ftp?????

Thanks as always,
Beaster
 
You could use grave accents:
tod=`date`

Then refer back with $tod.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top