Bash Shell - Append Date to Filename

Nov, 2017

Append the current date to a filename in Bash shell:

$ fname="/var/log/output-$(date +"%Y-%m-%d").log"
$ echo $fname
/var/log/output-2017-11-14.log
$