#! /bin/csh -f # # rename a file based on the EXIF time tag # to yyyy:mm:dd-hh:mm foreach file ($*) set t=(`exiftime -tc $file`) if ($#t == 4) then if ($t[1] == Image) then set new=$t[3]_$t[4]_$file echo $new mv -i $file $new endif else echo Something is wrong here. endif end