2011/3/23 Rony Bill gnulinuxist@gmail.com:
I am creating / appending files using a variable as the input name. Eg. $USER.jpeg makes a file called rony.jpeg . I want to add 2 variables to the file name instead of one and make $USER-$DATE.jpeg (rony-23/03/11.jpeg). What is the correct syntax for it as I keep getting errors in the mv as well as rename command. Tried $USER_$DATE or $USER.$DATE etc but no result. Did look up google but it has complex sed scripts.
Your $DATE appears to be misformatted - Linux (or for that matter, any Unix) cannot have filenames that contain the '/'. It is one of the two characters that are forbidden in filenames.
Apart from that, $USER-$DATE and $USER.$DATE both should work ($USER_$DATE will not). Please post actual script and its output for better debugging.
Binand