Data with quotes

Started by vacarisses, January 23, 2013, 07:04:39 AM

Previous topic - Next topic

vacarisses

Hello,
We're trying to add data to a jpeg file from command line with quotes info, i put a slash, but don't work
Ex:
exiftool -headline='pro\'va' test.jpeg

can you help me?

Thanks

Phil Harvey

I could help if I knew what operating system you are using.

- 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 ($).

vacarisses


Phil Harvey

With Mac/Linux, the easiest thing to do is use different quotes:

exiftool -headline="pro'va" test.jpg

This may be done with single quotes too, but in a bash shell nothing may be escaped inside single quotes so you have to end the quotes then escape the quote character then start the quotes again:

exiftool -headline='pro'\''va' test.jpg

Or, in this case since the other characters don't require quoting, this can be simplified to:

exiftool -headline=pro\'va test.jpg

- 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 ($).

Phil Harvey

I learn something new every day...

Reading more about bash, you can achieve escaping in single quotes by adding a "$" before the first single quote:

exiftool -headline=$'pro\'va' test.jpg

- 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 ($).

vacarisses

Good!!!!
Is working!!!!
Thanks for your quickly answer