Spaces in Command Line

Started by alaska_av8r, February 17, 2021, 03:45:27 PM

Previous topic - Next topic

alaska_av8r

Holy Cow this is driving me crazy.  I've looked all over but cannot get this to work consistently.

I am using this command line on my NAS (Linux) to change the model metadata to allow easier filtering.

What is giving me problems is dealing with spaces, should I be using single quotes, double quotes or no quotes at all in a command like shown below.

exiftool -m -model=iPhone 11 Video *.MP4

if i use single quotes it gives an error file not found for 11 and Video, if i use double quotes they show up in the metadata field.

** and will this be different on a Mac

thank you
tim

Phil Harvey

Hi Tim,

This should work in any o/s:

exiftool -m -model="iPhone 11 Video" *.MP4

- 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

Quote from: alaska_av8r on February 17, 2021, 03:45:27 PMif i use double quotes they show up in the metadata field.

** and will this be different on a Mac

Since you mention a Mac, double check to make sure you're using regular quotes ' & " and not fancy quotes  ' ' & " "

There's a setting on the Mac that will automatically turn regular quotes into fancy quotes, even in the terminal.  The terminal requires regular quotes.


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

alaska_av8r

StarGeek i checked and the quotes appear as straight as can be, I'll attach a screen shot.

Phil when I use "double quotes" then the field that I use them on, such as -make="Nikon Z7" -model="Nikon Z7 Video" shows up in Lightroom with the double quotes, I'll show you an example attached.

Also in reading your FAQ's and other places on the site you mention the drawbacks of using wildcards.  I searched to get an example of how I would use the command below pointed at a directory but could not find one, can you point me in the right direction.

exiftool -m -make="iPhone" -model="iPhone 11 Video" *.MOV

I just noticed and remembered something, I did not have any problems when I edited the Nikon Z7 and the Mavic Pro 2 drone videos, they display properly and take the command fine with no errors.  However when I downloaded my iPhone videos, that is when I ran into that Large File support not enabled error message and had to edit ExifTool_config.  That is when the problems began, not sure if that is coincidence or not.

tim




StarGeek

Quote from: alaska_av8r on February 18, 2021, 12:25:30 AM
StarGeek i checked and the quotes appear as straight as can be, I'll attach a screen shot.
<snip>
exiftool -m -make="iPhone" -model="iPhone 11 Video" *.MOV

You're using fancy quotes in this example, and that is what appears to be in your second image.  Compare them to the quotes in the GPS coordinates below.


Quote from: alaska_av8r on February 18, 2021, 12:25:30 AMAlso in reading your FAQ's and other places on the site you mention the drawbacks of using wildcards.  I searched to get an example of how I would use the command below pointed at a directory but could not find one, can you point me in the right direction.

On the command line, a single dot . indicates the current directory (two dots .. indicates the parent directory).  So your command would be
exiftool -m -make="iPhone" -model="iPhone 11 Video" -ext mov .
* 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).

alaska_av8r

StarGeek you are spot on, when i was typing into the terminal i was getting straight quotes, but I had the commands copied into a word document and it was changing the straight quotes to the fancy quotes, which I have never even heard of....

so at this point i think the problem is cured.......

nice job..

StarGeek

Quote from: alaska_av8r on February 18, 2021, 01:07:37 AM
StarGeek you are spot on, when i was typing into the terminal i was getting straight quotes, but I had the commands copied into a word document and it was changing the straight quotes to the fancy quotes

Ah, yes, I should have mentioned that as well.  MS Word, LibreOffice, Google Docs, and similar programs will try and "help" you by fixing quotes as well as other characters.
* 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).

alaska_av8r

Yes their help works wonderfully when you don't want it to, and when you need it, not so lucky....ha.   I am just excited to have finally made progress from all of the chaos of past 2 weeks trying to get perl installed and this working.  It drives me nuts to not know the ins/outs and make a computer do what i want it to do, even more so when you read and study and still can't figure it out.

Another one:
Following Phil's advice on avoiding using wildcards, what is the syntax to perform this command, exiftool -m -make="iPhone" -model="iPhone 11 Video" *.MOV on images contained in a directory called TEST


StarGeek

Same as I posted above, just change the dot . directory path to the path to your test vids.
* 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).

alaska_av8r

sorry i totally missed that, i got so excited that the problem had been fixed..... thank you