title: Bash: Running the same program over multiple cores
body: <p>I have access to a machine where I have access to 10 of the cores -- and I would like to actually use them. What I am used to doing on my own machine would be something like this:</p>
  
  <pre><code>for f in *.fa; do
    myProgram (options) "./$f" "./$f.tmp"
  done
  </code></pre>
  
  <p>I have 10 files I'd like to do this on -- let's call them blah00.fa, blah01.fa, ... blah09.fa. </p>
  
  <p>The problem with this approach is that myProgram only uses 1 core at a time, and doing it like this on the multi-core machine I'd be using 1 core at a time 10 times, so I wouldn't be using my mahcine to its max capability. </p>
  
  <p>How could I change my script so that it runs all 10 of my .fa files at the same time? I looked at <a href="https://stackoverflow.com/questions/7907406/run-a-looped-process-in-bash-across-multiple-cores">Run a looped process in bash across multiple cores</a> but I couldn't get the command from that to do what I wanted exactly.</p>