On 10/15/05, Gora Mohanty <[EMAIL PROTECTED]> wrote: > --- Manish Popli <[EMAIL PROTECTED]> wrote: > > Error is ..when i run it manually > > I din't get your mean about shell......... > > It is possible that the shell that the script is run > under is not bash, but some other shell that handles > variables differently. > > > [EMAIL PROTECTED] cvs_bkp]# date=`date -I` mv > > /home/manish/cvs_bkp/cvs_bkp.tar > > /home/manish/cvs_bkp/cvs_bkp$date.tar > > No, try it on two lines, as it was in the script, > i.e., > date=`date -I` > mv /home/manish/cvs_bkp/cvs_bkp.tar > /home/manish/cvs_bkp/cvs_bkp$date.tar > Or, simply execute the script itself. > No offence, but you would do well to get a book, > or some document on shell scripts, and read it. > This is quite basic stuff. > > Regards, > Gora
Hi manish! The rename by date works. here is the script to test - it works and also shows you your shell. Important : no blanks after date i.e. date=` --------script to test --------- #!/bin/bash # Next line shows you your current shell echo $SHELL # Note : no blanks before or after = i.e date=' date=`date -I` # test1 is a file in my home directory mv ~/test1 ~/test1$date # As Gora suggested ${date} better option ---------end of script---------- -gunz _______________________________________________ ilugd mailinglist -- ilugd@lists.linux-delhi.org http://frodo.hserus.net/mailman/listinfo/ilugd Archives at: http://news.gmane.org/gmane.user-groups.linux.delhi http://www.mail-archive.com/ilugd@lists.linux-delhi.org/