Ubuntu: commands with ' ' are failing
hi,
the following appears to be failing. i hope someone can tell me why.. so i'm trying to create a file with the current date as the prefix in the following way (following instructions from a tutorial): Code:
touch 'date +%F'.log date +%F.log instead of 2011-07-31.log i also tried the following: Code:
var='expr 1 + 2' expr 1 + 2 what am i getting wrong/missing/failing to understand? thanks! |
Use backticks instead of ticks
Code:
fortyfourgalena@desktop-01:~$ touch `date +%F`.log |
Or try $(); easier to read
Code:
touch $(date +%F).log |
Quote:
|
Yeah, I'm old school myself, but it is easier to read, especially across environments. I actually tested that on the Solaris system in front of me, just to see if it worked there.
|
Quote:
And honestly, I don't think I will be ever considered "new school....." ;) |
All times are GMT -5. The time now is 03:57 PM. |