#! /bin/bash # Script: FindMissingTif.sh # Purpose: Find RAW files without an associated TIF file in the same dir/name, # meaning that you haven't processed it yet. # It assumes you save your TIF should be in the same location. # # Author: Guillaume Dargaud - http://www.gdargaud.net/ # Copyright: (c) 2006 - Free use, distribution and modification # # You need cygwin to run this on Windows: http://www.cygwin.com/ # To launch this from Explorer, create a FindMissingTif.bat file with the following: # SET PATH="/usr/local/bin:/usr/bin:/bin" # c:\cygwin\bin\bash FindMissingTif.sh # PAUSE ############################################################################### # Pass a DNG/RAW/RAF/whatever file. It will check for the existence of a TIF file at the same place # If you save to JPG instead of TIF, change accordingly function FindTifFromRaw { if [ $# -ne 1 ]; then exit; fi # Error, even the RAW file doesn't exist !!! # Replace extension tif=$( echo "$1" | sed -e "s/\.[a-zA-Z0-9]*$/.tif/" ) && TIF=$( echo "$1" | sed -e "s/\.[a-zA-Z0-9]*$/.TIF/" ) && if [ ! -f "$tif" -a ! -f "$TIF" ]; then # Chose one or more of the lines below: # echo $1 # Display file name in Linux format cygpath -w "$1" # Display file name in Windows format cygstart explorer /e,/select,"$(cygpath -w "$1")" read -p "Press [enter] to continue" fi } export -f FindTifFromRaw ############################################################################### # Now let's look under the current directory. Add whatever RAW format you wish here echo "Raw files without an equivalent TIF file:" find \( -iname \*.raf -o -iname \*.dng -o -iname \*.nef -o -iname \*.raw -o -iname \*.crw -o -iname \*.cr2 -o -iname \*.mrw -o -iname \*.orf -o -iname \*.ptx \) -exec bash -c "FindTifFromRaw \"{}\"" \;