My script is the following:
myDate=`date +%Y-%m-%d`
fileName=archive-$myDate
The date is less human-readable, but the file names "archive-2003-10-21".
So they appears in a chronological order with a 'ls -l'.
You'll get more information with 'man date'.
Xavier
PS : You can also directly use the 'date' command in you command line : cp -a ~/evolution ~/evolution-`date +%Y-%m-%d` or with compression : tar zxvf ~/evolution-`date +%Y-%m-%d`.tar.gz ~/evolution
Arindam Dey wrote:
On Tue, 2003-10-21 at 14:22, kent emia wrote:
$date=date
//## trying ~$ $data=date bash: =date: command not found
//##searching for the date ~$ whereis date date: /bin/date /usr/share/man/man1/date.1.gz
//##applying full path ~$ $date=/bin/date bash: =/bin/date: No such file or directory
//## trying to type only date at the prompt ~$ date Tue Oct 21 14:14:12 PHT 2003
hello=`date` echo $hello
Mind the backquotes around date...usually the key before 1 at least on my keyboard.
-- Xavier BLANADET - Ingénieur R&D - xavier.blanadet@xxxxxxxxxxxxx R.S.A.Cosmos - Conception et Fabrication de Planétariums - http://www.rsacosmos.com Rue des mineurs - ZI de la Vaure - 42290 - SORBIERS (France)
-- Shrike-list mailing list Shrike-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/shrike-list