ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: rhybroy on March 28, 2023, 01:09:29 AM

Title: trouble with if condition
Post by: rhybroy on March 28, 2023, 01:09:29 AM
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.
Title: Re: trouble with if condition
Post by: StarGeek on March 28, 2023, 01:23:03 AM
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.
Title: Re: trouble with if condition
Post by: rhybroy on March 28, 2023, 06:25:46 AM
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