Here is what I have so far
#!/bin/bash
while [ $# -gt 0 ]
do
read image
jpegtopnm $image | pnmscale -height 200 | pnmtojpeg > $image-thumb
echo $image-thumb
shift
done
I sorta threw some pseudocode in there to demonstrate what I'm trying to do. . Where I am stuck is, I am trying to read in a list of images. The while/do works fine but I get confused as to how to represent all the images in the list as a single item such as '$image' because I need to scale all of them and them spit them back out on the command line with new names by adding -thumb to their names. Also I'm trying to make it JPG specific meaning if the list gets a .html file for example by accident it should skip over it. My biggest problem is I dont know how to represent a list of items as a single variable if that is the right word. Any help just to get started in the right direction is appreciated. . thank you
---------- Post updated at 04:31 PM ---------- Previous update was at 04:29 PM ----------
edit here is an update to what I have changed
#!/bin/bash
for img in *.jpg
do
jpegtopnm $img | pnmscale -height 200 | pnmtojpeg > $img-thumb
echo $img
shift
done