trouble with if condition

Started by rhybroy, March 28, 2023, 01:09:29 AM

Previous topic - Next topic

rhybroy

i tried to compare the photo date.
when
exiftool -T -filename -if '$datetimeoriginal gt "2012:03:28 00:00:00"' ./
get results.
but
exiftool -T -filename -if "$datetimeoriginal gt '2012:03:28 00:00:00'" ./
get error by return signal 2.
only just changed the quote mark ' to " after if.

the datetimeoriginal  of images for test is set up by 2012:03:28 09:00:00.

StarGeek

Quote marks matter depending upon what command line you're using.  The fact that the first one works indicates that you're probably using Mac/Linux/PowerShell.  The second command would be what to use under Windows CMD.

Double quotes under Mac/Linux means the dollar sign $ is treated as the start of a command line variable, not an exiftool tag name.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

rhybroy

thanks. got it.
if i batch updated some images, how to get the list result of which file had been updated.
for now, only display a total number of results like:
Quote6 files failed condition
3 image files updated