When are " " needed around writing commands? Clarification.

Started by tommyzebman, February 24, 2019, 12:04:58 PM

Previous topic - Next topic

tommyzebman

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

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

And again, I'm too slow :D

QuoteSuch 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.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).