I was running ExifTool with some if condition to test for a tag on Windows. Everything worked fine.
Tried then to run on both my QNAP NAS and a Raspberry Pi and the if test is not working - even if the tag is present:
pi@raspberrypi:./exiftool -if "$ContentIdentifier" *.MOV
1 files failed condition
pi@raspberrypi:./exiftool -s -ContentIdentifier *.MOV
ContentIdentifier : C65670FC-ACC2-47E1-AF37-7533F8097ABE
Running on Windows - it is fine:
exiftool(-k).exe if "$ContentIdentifier" -p "$directory/$filename" *.MOV
./IMG_6852_HEVC.MOV
What is going on here - why is the if test not working on Linux OSes?
From the bottom of every one of Phil's posts
QuoteOn Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).
The dollar sign is the start of a shell variable when there are double quotes around it.
Quote from: StarGeek on September 28, 2022, 05:05:08 PMThe dollar sign is the start of a shell variable when there are double quotes around it.
Thank you! Changed to single quotes and it worked perfectly!