exiftool......command not found! Yikes!

Started by yamaha evans, June 18, 2013, 11:41:11 PM

Previous topic - Next topic

yamaha evans

I have a bash script that conducts forensic data triage on collections of forensic acquisition images, which has been under constant improvement and development.  Recently I decided to integrate a means of extracting the metadata from all files identified by the script.

The script basically runs a "find" command based on file extension, and recreates only those files matching the file extension criteria to a different location.

For each recreated directory structure, from the root location, I wanted to run something along these lines:

function extract_metadata () {
SAVEIFS=$IFS
   METAREPORT=<path to an output report>
   IFS=$(echo -en "\n\b")
   unset NOTETITLE
   NOTETITLE="RECOVERED FILE METADATA"
   echo -e "$UNDERLINE$UNDERLINE\n\t\t$NOTETITLE$NOTEHEADER" > $METAREPORT
      cd  <path to recreated directory structure containing files found by the "find" command>
      exiftool -r ./ >> $METAREPORT
      cd <path to recovered deleted files>
      exiftool -r ./ >> $METAREPORT
   IFS=$SAVEIFS   
}


Here's the problem:

When I run the script WITHOUT calling this function, then it runs correctly.

When I run the script WITH calling this function, the script runs without incident for the FIRST forensic image, but when it processing subsequent forensic images, the find command errors out with "find . /noleaf /-type f: command not found".

The only thing I can see happening is that the function is changing to two different directories and running exiftool each time, appending the output to a report document.

ANY ideas why I'm getting a "file not found" after exiftool runs?

Thanks in advance, I'm sorry if this is a little too vague.  Anyone here who is a bash guru will quickly realize that I'm not even a programmer, let alone a guru!

Yamaha

Phil Harvey

Hi Yamaha,

I'm not sure if this would help, but what happens if you try

      exiftool -r <path to recreated directory structure containing files found by the "find" command> >> $METAREPORT
      exiftool -r <path to recovered deleted files> >> $METAREPORT


instead of

      cd  <path to recreated directory structure containing files found by the "find" command>
      exiftool -r ./ >> $METAREPORT
      cd <path to recovered deleted files>
      exiftool -r ./ >> $METAREPORT


?

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

yamaha evans

Yessir, that was the trick!  I don't know how or why, but it now works!  Thank you for the assist!

Yamaha