Bash example: Listing files in a directory
Simple example of how to perform an operation on every file in a directory:
for file in `ls *.pdf`
do
convert -density 300 $file `echo $file | sed 's/\.pdf$/\.jpg/'`
done
Posted: November 13th, 2010 under Linux.
Comments: none