Dealing with filenames starting with a hyphen "-"

Started by obetz, July 01, 2019, 05:45:18 AM

Previous topic - Next topic

obetz

Hi all,

anybody out there working with filenames starting with a hyphen, e.g. "-foo.jpg" or even "-ver"?

Although this would be no more "Posix portable", it's allowed by the OS.

What is a clean way to pass such a filename to ExifTool, prepending with "./"?

Oliver

Phil Harvey

Yes.  Put the directory name before the file name if the file name begins with a dash.

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