Thursday, April 10, 2008

bash: simple loop through files

for f in *.tiff ; do echo $f; done
Example with ImageMagick's convert program: for f in *.tiff; do convert -crop 384x384+48+35 $f out/$f; done

1 comment:

  1. Use more quotes. Your method fails as soon as a file name contains a space. Oh and what if a file name starts with a hyphen?

    ReplyDelete