Created
August 8, 2016 05:41
-
-
Save nebgnahz/9805767d5ee987c10d854c94e627aa22 to your computer and use it in GitHub Desktop.
Clean up SDCard. I normally scan my photos with JPG because it's much faster to load. And I will make changes, delete bad ones, during the scan. In the end, I want the corresponding CR2 whose JPG counterparts have been removed being cleaned. This script does the job.
This file contains 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/sh | |
set -e | |
cd /Volumes/CANON/DCIM/100CANON; | |
for f in *.CR2 | |
do | |
b=$(basename $f .CR2) | |
if [ ! -f "/Volumes/CANON/DCIM/100CANON/$b.JPG" ]; then | |
rm $b.CR2 | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment