Skip to content

Instantly share code, notes, and snippets.

@kgabis
Created July 14, 2013 17:30
Show Gist options
  • Select an option

  • Save kgabis/5995022 to your computer and use it in GitHub Desktop.

Select an option

Save kgabis/5995022 to your computer and use it in GitHub Desktop.
Removing orphaned raws (without matching JPG file higher in hierarchy).
#!/bin/bash
RAWS=raws/*.NEF
for raw in $RAWS
do
echo -n "Checking $raw - "
rawb=$(basename $raw)
jpg="${rawb%%.*}.JPG"
if [ ! -f $jpg ];
then
echo "$jpg not found! Removing $rawb"
rm $raw
else
echo "$jpg found."
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment