Quantcast
Viewing latest article 4
Browse Latest Browse All 6

Answer by Arcege for Appending a current date from a variable to a filename

More than likely it is your use of set. That will assign 'today', '=' and the output of the date program to positional parameters (aka command-line arguments). You want to just use C shell (which you are tagging this as "bash", so likely not), you will want to use:

today=`date +%Y-%m-%d.%H:%M:%S` # or whatever pattern you desire

Notice the lack of spaces around the equal sign.

You also do not want to use & at the end of your statements; which causes the shell to not wait for the command to finish. Especially when one relies on the next. The find command could fail because it is started before the mkdir.


Viewing latest article 4
Browse Latest Browse All 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>