title: format bash variable for command
body: <p>From my bash shell I would like to call a program n times with a different numbered parameter, which has to be in a fixed format like "%02i"</p>
  
  <p>One way would be:</p>
  
  <pre><code>for ((i=23; i&lt;42;i++)); do 
      sh ../myprogram `printf "%02i\n" $i`
  done
  </code></pre>
  
  <p>Is there a way to improve the <code>printf..</code> part? I believe this might be a performance bottleneck with more files and makes the line less readable than a built-in function (especially when condensed to a one-liner).</p>