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

Date-stamp in filename for a script



Excuse my ignorance in shell scripting, but I wanted to create a file that 
actualy had a filename that contains the date in the format:

backupYYMMDD.tar.gz

I can do:
date +backup%y%m%d.tar.gz

which give the correct output for the filename.  If I assign that to an environment 
variable such as TIMESTAMP:

TIMESTAMP='date +backup%y%m%d.tar.gz'

How can I use this as:
touch $TIMESTAMP

...or...

tar czvf $TIMESTAMP /

ect... I have seveal uses for this concept, and I know you guru scripters do this 
in your sleep.  any help?

--Jay


--  
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: