Escape spaces in file names?

Started by Archive, May 12, 2010, 08:54:30 AM

Previous topic - Next topic

Archive

[Originally posted by jcrunch on 2009-01-21 06:42:48-08]

I'm trying to save keywords to jpegs in my photo website directory. Unfortunately, some of the directories have spaces in them.

In the exiftool command, do I have to escape the spaces in the directory references, and if so, with what?

Here's a sample command: exiftool -keywords=Ariana '/Volumes/Macintosh HD/Library/WebServer/Documents/familyphotos/1999 Photos/Ariana/slides/1999-07-17_10-39-09.jpg'

And, yeah, this is in Mac OS X 10.5.

Archive

[Originally posted by exiftool on 2009-01-21 11:19:03-08]

Any special characters (spaces, dollar signs, greater than, less than, etc)
must be either quoted or escaped with backslashes.  Quotes are simplest.
What you have done with the single quotes should work fie.

- Phil

Archive

[Originally posted by jcrunch on 2009-01-21 15:35:17-08]

Thanks, Phil. My problem must lie elsewhere, then.

Archive

[Originally posted by exiftool on 2009-01-21 16:31:16-08]

Two suggestions:

1) When typing a filename in Terminal, use the TAB key to complete
each directory/file name -- then you can be sure you didn't spell it
wrong.  It also saves a lot of typing.

2) You can drag a file onto the Terminal window, and this will enter
the filename for you.  No typing required at all.   Using this technique,
special characters are escaped automatically
using backslashes.

- Phil

Archive

[Originally posted by jcrunch on 2009-01-21 17:28:07-08]

Thanks for the tips, Phil. Unfortunately, I'm not using Terminal, but rather running exiftool via a procedure in a database that executes a script (the exiftool command line, which is generated by the database, complete with file name and keywords). I've checked the generated command line, and it appears correct (with quoted file name, as you noted should work). I'm trying to execute the command-line script over my local area network, which must be where my problem is. I've run a different procedure that builds an exiftool command and runs it locally, and it works, so something about my network is the issue here, I suspect.

Archive

[Originally posted by exiftool on 2009-01-21 17:35:03-08]

I find that I have to quote arguments _and_ escape spaces with
backslashes when running commands via ssh, if this is what you
are doing.  I'm not sure why, but ssh seems to strip one level of
quoting from the arguments.

- Phil