Advertisement
illwieckz

remove jpg if raw

Jun 11th, 2017
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. #! /bin/sh
  2.  
  3. # delete jpg from subdir if raw exists
  4.  
  5. find * -name '*.NEF' -o -name '*.CR2' \
  6. | while read raw
  7. do
  8.     jpg="$(echo "$raw" | sed -e 's/....$//').JPG"
  9.     if test -e $jpg
  10.     then
  11.         echo "because “$raw”; delete “$jpg”"
  12.         rm -v "$jpg"
  13.     fi
  14. done
  15.  
  16. #EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement