How would I go about checking if a value matches?
My use case is I want to check if "-Make" == "FUJIFILM".
My little understanding would be something like:
-exiftool [path] -Make == FUJIFILM
Try this:
exiftool -filename -if "$make =~ /FUJIFILM/i" FILE
The comparison above will match "FUJIFILM" anywhere in the Make value, ignoring case. And print the file name if it matches.
- Phil
Quote from: Phil Harvey on July 26, 2023, 04:07:02 PMTry this:
exiftool -filename -if "$make =~ /FUJIFILM/i" FILE
The comparison above will match "FUJIFILM" anywhere in the Make value, ignoring case. And print the file name if it matches.
- Phil
I tried that option and get the following:
Error: File not found - FILE
You were meant to enter any valid file name, not "FILE" literally.
1 files failed condition
0 image files read
1 files could not be read
I tried removing "FILE" from the end and get this result:
1 files failed condition
But it should match.
I'm on Mac so I needed to use single quotes. It seems to be working.
How would I have it return 'true' instead of the file name?
Yes. My signature tells about the quoting. I assume Windows unless told otherwise.
The exit status will be 0 on success, or 2 if the file failed the condition.
- Phil