Quotes in bash script

I am trying to run the following bash script. Converting an MTS file to an mp4 file, copying all time tags to the new mp4 file, and then adding the CreateDate tag with the correct date. Everything works except for the last command. I believe it has something to do with the quotations.
The problem in particular is when I attempt to set the CreateDate tag. The following works in the Mac Terminal, but it doesn't not work within Hazel:
/usr/local/bin/exiftool '-CreateDate=2021-12-06 12:00:00-5:00' filename.mp4
Help?
- Code: Select all
date="$(<<< /usr/local/bin/exiftool -s -s -s -DateTimeOriginal $1)"
ifilename=$(basename $1)
ifilename="${ifilename%.*}"
/usr/local/bin/ffmpeg -i $1 -vcodec copy -acodec copy -map_metadata 0 "${ifilename}.mp4"
/usr/local/bin/exiftool -tagsFromFile $1 -overwrite_original -time:all "${ifilename}.mp4"
/usr/local/bin/exiftool "'-CreateDate=${date}'" "${ifilename}.mp4"
The problem in particular is when I attempt to set the CreateDate tag. The following works in the Mac Terminal, but it doesn't not work within Hazel:
/usr/local/bin/exiftool '-CreateDate=2021-12-06 12:00:00-5:00' filename.mp4
Help?