title: Looping through all files in a given directory
body: <p>Here is what I'm trying to do:</p>
  
  <p>Give a parameter to a shell script that will run a task on all files of jpg, bmp, tif extension.</p>
  
  <p>Eg: ./doProcess /media/repo/user1/dir5</p>
  
  <p>and all jpg, bmp, tif files in that directory will have a certain task run on them.</p>
  
  <p>What I have now is:</p>
  
  <pre><code>for f in *
  do
    imagejob "$f"  "output/${f%.output}" ;
  done
  </code></pre>
  
  <p>I need help with the for loop to restrict the file types and also have some way of starting under a specified directory instead of current directory.</p>