Yes it works, remove -n option or add a number after n between 100 to 1000, its some noise canceler thingy. Also note that its case sensitive. Mine cr2 files was UPPERCASE and below script worked for me. I also used -v (verbose)

for i in *.CR2; do dcraw -c -a -v $i | ppmtojpeg > `basename $i CR2`jpg; echo $i done; done