title: BASH - Syntax error near unexpected token 'done'
body: <p>I'm new to programming in bash and am trying to write a script. So far it's very rudimentary but I'm getting the above error with the <code>done</code> at the end.</p>
  
  <pre><code>for ((i = 1; i &lt; 13; i++)) do
      if [ "$i" -lt "4" ]; then
          touch Block1/B8IT11"$i".txt
          echo B8IT11"$i" created
      else if [ "$i" -gt "3" -a  "$i" -lt "7" ]; then
          touch Block2/B8IT11"$i".txt
          echo B8IT11"$i" created
      else if [ "$i" -lt "6" -a  "$i" -lt "10" ]; then
          touch Block3/B8IT11"$i".txt
          echo B8IT11"$i" created
      else
          touch Block4/B8IT11"$i".txt
          echo B8IT11"$i" created
      fi
  done
  </code></pre>
  
  <p>To my eyes I can't see the issue, as the <code>if-else if-else</code> ends with <code>fi</code> and the <code>for</code> loop should terminate with the <code>done</code>.</p>
  
  <p>I've done <code>cat -v</code> and even <code>dos2unix</code> it. Does anyone see something I'm missing?</p>