syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me

Question:
In Bash how do I place date-string in filename?

I often write Bash scripts requiring me to create a log file which has a date-string in the filename.

I offer a Bash syntax demo below:
myts=`date --utc +'%Y%m%d_%H_%M_%S'`
echo The UTC time is now $myts > /tmp/timenow_${myts}.txt


syntax.us Let the syntax do the talking
Blog Contact Posts Questions Tags Hire Me