Directory

Started by Sy, September 10, 2013, 06:14:13 PM

Previous topic - Next topic

Sy

I run exiftool from a shell script.  I use the -geotag option to add geo data to the jpeg-exif.

The files are in the current working directory.  Th original files a re on directory above the current working directory.

When I run the shell script it modifies the files in the current directory AND the original files in the directory above the current directory.

How can I limit the scope of exiftool?

Here is the shell script:

#! /bin/bash
echo
if [ $# -lt 1 ]
then
   echo " Syntax: geotag log-file image-file"
   echo " Image-file can be a wildcard"
   exit
fi

for fn in $@
   do
   if [ $fn != $1 ]
   then
      echo " Processing file: $fn"
      exiftool  -P -geotag $1 `pwd`/$fn
   fi
done


Phil Harvey

ExifTool will only modify the files that you tell it to.  Your script must be either specifying the files in the parent directory, or the parent directory itself.  Check your script.

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