title: How to add leading zeros for for-loop in shell?
body: <p>I have a basic number for loop which increments the variable num by 1 over each iteration...</p>
  
  <pre><code>for (( num=1; num&lt;=5; num++ ))
  do
   echo $num
  done
  </code></pre>
  
  <p>Which outputs:</p>
  
  <pre><code>1
  2
  3
  4
  5
  </code></pre>
  
  <p>I'm trying to make it produce the output (add leading zero before $num):</p>
  
  <pre><code>01
  02
  03
  04
  05
  </code></pre>
  
  <p>Without doing:</p>
  
  <pre><code>echo 0$num
  </code></pre>