title: resizing images with imagemagick via shell script
body: <p>I don't really know that much about bash scripts OR imagemagick, but I am attempting to create a script in which you can give some sort of regexp matching pattern for a list of images and then process those into new files that have a given filename prefix.</p>
  
  <p>for example given the following dir listing:</p>
  
  <blockquote>
    <p>allfiles01.jpg allfiles02.jpg
    allfiles03.jpg</p>
  </blockquote>
  
  <p>i would like to call the script like so:</p>
  
  <pre><code>./resisemany.sh allfiles*.jpg 30 newnames*.jpg
  </code></pre>
  
  <p>the end result of this would be that you get a bunch of new files with newnames, the numbers match up,</p>
  
  <p>so far what i have is:</p>
  
  <pre><code>IMAGELIST=$1
  RESIEZFACTOR=$2
  NUMIMGS=length($IMAGELIST)
  
  for(i=0; i&lt;NUMIMGS; i++)
    convert $IMAGELIST[i] -filter bessel -resize . RESIZEFACTOR . % myfile.JPG
  </code></pre>
  
  <p>Thanks for any help...
  The parts that I obviously need help with are
  1. how to give a bash script matching criteria that it understands
  2. how to use the $2 without having it match the 2nd item in the image list
  3. how to get the length of the image list
  4. how to create a proper for loop in such a case
  5. how to do proper text replacement for a shell command whereby you are appending items as i allude to.</p>
  
  <p>jml</p>