http://blog.l33t.name/53c2ada0eb8d8137c00013eb update convert each cr2 image to jpg in a folder for image in *.CR2 ; do dcraw -c -q 0 -w -H 5 -b 8 $image | cjpeg -quality 80 > ${image%.CR2}.jpg ; done