1 #!/bin/bash
 2 
 3 #rm HEADER.html
 4 touch HEADER.html
 5 
 6 for image in P[a-zA-Z0-9]*.JPG; do
 7     i=${image%%.JPG}
 8     echo $image
 9     jpegtopnm $image | pnmscale -xysize 100 100 | pnmtojpeg > _thumb${i}.jpg
10     echo "<a href=\"${image}\" target=\"new\"><img src=\"_thumb${i}.jpg\"></a>" >> HEADER.html
11 done


syntax highlighted by Code2HTML, v. 0.9.1