Using Double Quotes vs Single quotes in EXIF statement

Started by Wranglerdave, October 13, 2018, 09:16:26 AM

Previous topic - Next topic

Wranglerdave

I know that double quotes (") s/b used in windows and single quotes (') in Mac OS... I am running Mac Pro using Bash.  There are times when I have to change single quotes to double or visa versa in order for the same EXIF statement to work.  The file or directory is not found is the typical error message I get when this happens.  Any idea why and what can be done to only use one style?  Thanks.

Alan Clifford


StarGeek

Can you give an example of a single quoted command that doesn't work with bash?

Are you making sure that they are single quotes ' and not fancy quotes ' ' (don't copy/paste commands into a word processor)?   

As long as you have single quotes around an command argument and double quotes (if needed) inside the single quotes, you shouldn't have a problem under bash.
* 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).

Wranglerdave

Sorry for not getting back to you sooner but I have been out of town.

Here are the commands that I have been using on jpg files:
ExifTool "-FileModifyDate>XMP-Exif:DateTimeOriginal" "-filemodifydate>XMP-xmp:CreateDate" "-FilemodifyDate>XMP-xmp:ModifyDate" \downloads/work

exiftool '-Alldates<CreateDate' '-CreateDate>FileModifyDate' \downloads/work

As far as I know there is only one type of quote (') on the Mac.  If there are others, I am not aware of them.

Thanks for your response.

StarGeek

Those are fancy quotes.  Notice how they are angled. 
"" ''

In bash you need to use straight quotes
" '

Are your example commands directly typed into bash or are you copy/pasting from another source?  If the latter, then your source has incorrect quotes.  Hopefully, typing directly into bash should not automatically convert the quotes.

I did come across this superuser post.  The second half of it details how to turn off automatic quote replacement. 

* 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).

Wranglerdave

I was typing the commands in and I did have the smart quote replacement turned on. I have now turned this option off.  The commands (with either the double or single quote) work.

Thanks for your help with this.