Concat Variable (date) and String in shell unix - bash

前端 未结 3 706
Happy的楠姐
Happy的楠姐 2021-01-03 11:42

I\'m trying to concat a var (date) and string to have a file with current date name.

My code.

days=\"$(date +\"%Y%m%d_%H%M\")\"
echo \"SKIP\" > ${         


        
3条回答
  •  悲哀的现实
    2021-01-03 12:42

    try to remove the redundant double quote in your first variable assignment.

    $ days=$(date +%Y%m%d_%H%M)
    $ echo $days #see what output will get?
    $ echo "SKIP" > ${days}_EMERGENCY.txt
    

提交回复
热议问题