Author Topic: When are " " needed around writing commands? Clarification.  (Read 155 times)

tommyzebman

  • Jr. Member
  • **
  • Posts: 12
When are " " needed around writing commands? Clarification.
« on: February 24, 2019, 12:04:58 PM »
Just wanted to confirm that " " are not needed when writing data to a tag such as:  exiftool   -imagenumber=2222  "DIRsource"   ,  however, always required when copying data from one tag to another tag.

Such as:  exiftool   "-imagenumber<filenumber"  "DIRsource"   I do not see this written down/explained anywhere, but probably missed it.  I use Windows so always  " " vs. ' ' I believe.

The logic evades me, but that is not important, rather that I know the rules for sure.

Thanks for the clarification.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14879
    • ExifTool Home Page
Re: When are " " needed around writing commands? Clarification.
« Reply #1 on: February 24, 2019, 12:28:05 PM »
Quoting is a feature of the Windows shell you are using.  For cmd.exe, you need to quote spaces and some other characters.  No quotes are needed at all if you put the command arguments inside an exiftool -@ argfile.

See this post by StarGeek explaining when quotes are necessary in Windows.

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

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2562
Re: When are " " needed around writing commands? Clarification.
« Reply #2 on: February 24, 2019, 12:32:01 PM »
And again, I'm too slow :D

Quote
Such as:  exiftool   "-imagenumber<filenumber"  "DIRsource"   I do not see this written down/explained anywhere, but probably missed it.

You can find it under the -TAG<=DATFILE / -TAG<=FMT option or the following -TagsFromFile option, maybe elsewhere.  The key term is "Redirection", which is the special function of the command line with regards to the greater/less than symbols.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.