Created
July 14, 2013 17:30
-
-
Save kgabis/5995022 to your computer and use it in GitHub Desktop.
Removing orphaned raws (without matching JPG file higher in hierarchy).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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