### multiple files foreach file ( `ls *.{gif,jpeg,jpg,png}` ) foreach? echo $file | awk '{print "convert -size 60x60",$1,"-resize 60x60",substr($1,1,index($1,".")-1)"_thumb"substr($1,index($1,"."))}' | csh foreach? end ### single file set file= echo $file | awk '{print "convert -size 60x60",$1,"-resize 60x60",substr($1,1,index($1,".")-1)"_thumb"substr($1,index($1,"."))}' | csh