title: A bash loop with braces?
body: <p>I stumbled across this oddity and can't quite figure out why it works:</p>
  
  <pre><code>$ for ((i=0;i&lt;8;i++)) {
  &gt;   printf '%d...' "$i";
  &gt; }; echo
  0...1...2...3...4...5...6...7...
  </code></pre>
  
  <p>A <code>for</code> loop in bash using <em>brace</em> syntax? I can't reproduce this using a non-arithmetic <code>for</code> loop at all, and the manpage and <code>help</code> both seem to require the <code>do</code>:</p>
  
  <pre><code>$ help for
  &lt;SNIP&gt;
  for ((: for (( exp1; exp2; exp3 )); do COMMANDS; done
      Arithmetic for loop.
  
      Equivalent to
          (( EXP1 ))
          while (( EXP2 )); do
              COMMANDS
              (( EXP3 ))
          done
  </code></pre>
  
  <p>Hmm, so if I just…</p>
  
  <pre><code>$ ((i=0)); while ((i&lt;8)) { printf '%d...' "$i"; ((i++)); }
  -bash: syntax error near unexpected token `{'
  </code></pre>
  
  <p>Nope!</p>
  
  <p>Is this braced <code>for-loop</code> syntax</p>
  
  <ol>
  <li>Documented anywhere (official?)</li>
  <li>A legitimate different way to represent an arithmetic for loop in Bash?</li>
  <li>Just something I'm missing about how a "normal" arithmetic for loop is interpreting the input?</li>
  </ol>
  
  <p><em>P.S. – This was tested on OS X Mavericks with both a homebrew-installed Bash 4.2.45(2)-release as well as the vanilla 3.2.51(1)-release.</em></p>