I am trying to output stored variable as a file name. However only one variable is displayed in the file name. $1
is "HH"
on the command line and filecount is equal to 13
. The output file name is 2019-07-24-16:44:56.csv
. I can not get the "HH"
in the beginning of the file name. I would like to see a file as sure HH_2019-07-24-16:44:56-13.csv
. I am missing something?
#count the number of html email files in current directory
filecount=$(ls -1 *.html | grep -v '/$' | wc -l)
#Current date file is created
filedate=$(date +%F-%T)
filename="$jobtype$filedate-$filecount.csv"
echo $jobtype >> $filename
echo $filecount >> $filename
echo $filedate >> $filename