What is the difference between "=" and "<" ?

Started by Tarn, March 07, 2013, 09:47:03 PM

Previous topic - Next topic

Tarn

  After botching things up and having to re-construct the original file name, I tried this command:
U:\Working>et -P -m -overwrite_original -Usercomment="P706${filename;$_=substr($_,-8,4)}.JPG" .
and all it did was put "P706${filename;$_=substr($_,-8,4)}.JPG" into UserComment. However, change it to:
U:\Working>et -P -m -overwrite_original -Usercomment"<P706${filename;$_=substr($_,-8,4)}.JPG" .
and it put "P7060128.JPG", "P7060129.JPG", etc. just fine.

I know it was replacing the equal sign with the less than sign and moving it inside the quote. But I don't understand why. Can anyone explain?

Thanks.

Phil Harvey

This is just the notation the exiftool uses.  An "=" is used for a simple string assignment (ie. -title="some text").  A "<" is used to copy the value of one tag to another (ie. -title<filename).  And an extra feature when copying allows a format string containing tag names prefixed by "$" to be used.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).