I create a variable and store the day, date & time in it:
NOW=$(date "+%a %d/%m/%Y% %H:%M")
Then I would like to pass $NOW
to the mv
command to rename a file.
e.g. Create file named a.txt with a title and the current date:
printf "File Report (" > ~/Desktop/a.txt
echo $NOW"):\n" >> ~/Desktop/a.txt
Then I try to rename the file with the variable ($NOW) included in the name:
mv ~/Desktop/a.txt ~/Desktop/'File Report $NOW'.txt
What should that last line be? I also tried these two options.
mv ~/Desktop/a.txt ~/Desktop/'File Report' $NOW.txt
&
mv ~/Desktop/a.txt ~/Desktop/'File Report'${NOW}.txt