title: How to iterate over arguments in a Bash script
body: <p>I have a complex command that I'd like to make a shell/bash script of.  I can write it in terms of <code>$1</code> easily:</p>
  
  <pre><code>foo $1 args -o $1.ext
  </code></pre>
  
  <p>I want to be able to pass multiple input names to the script. What's the right way to do it?  </p>
  
  <p>And, of course, I want to handle filenames with spaces in them.</p>