News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Problem writing to a tag from a text file (in a shell)

Started by philbond87, July 02, 2020, 12:17:16 PM

Previous topic - Next topic

philbond87

I'm trying to execute the following command through a shell (on Mac OS):

exiftool -overwrite_original_in_place -usageterms<= /Users/JohnDoe/Library/Application Support/MyApp/UsageTerms.txt /Users/JohnDoe/Library/Application Support/MyApp/Image.jpg

What I'm getting is "bash: =: No such file or directory"

Both files do exist at the paths sent to exiftool.
It seems as though exiftool is ignoring everything after the "<" symbol.

For example, if I have a space after the equals sign I get the message above.
If I have no spaces after the "<=" combination I get:

bash: =/Users/JohnDoe/Library/Application Support/MyApp/UsageTerms.txt: No such file or directory

What am I doing wrong?
Thanks!

StarGeek

From the docs
   Note that quotes are required around this argument to prevent shell redirection since it contains a < symbol.

Try
'-usageterms<=/Users/JohnDoe/Library/Application Support/MyApp/UsageTerms.txt'

Additionally, any argument that has a space in it either needs quotes or needs to escape the space
'/Users/JohnDoe/Library/Application Support/MyApp/Image.jpg'
or
/Users/JohnDoe/Library/Application\ Support/MyApp/Image.jpg
* 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).

philbond87

Thanks for that. I feel I'm getting closer.

Now, however, my new command is:
exiftool -overwrite_original_in_place '-UsageTerms<=/Users/JohnDoe/Library/Application\ Support/MyApp/UsageTerms.txt' /Users/JohnDoe/Library/Application\ Support/MyApp/Image.jpg

And I'm getting the error:
Error opening file /Users/JohnDoe/Library/Application\ Support/MyApp/UsageTerms.txt
Nothing to do.


philbond87

Ah... never mind.
I forgot to "un" escape the spaces in the path once I single quoted.