> On Aug 6, 2020, at 10:29 PM, Dale R. Worley <wor...@alum.mit.edu> wrote: > > Klaas Vantournhout <klaas.vantournh...@gmail.com> writes: >> Recently I came across a surprising undocumented bash-feature >> >> $ for i in 1 2 3; { echo $i; }; >> >> The usage of curly-braces instead of the well-documented do ... done >> construct was a complete surprise to me and even lead me to open the >> following question on stack overflow: > > Interesting! Looking at parse.y, it looks like do ... done can be > replaced with { ... } in 'for' and 'select' statements, but not 'while' > and 'until' statements. Not clear why that would be
Unless I'm quite mistaken, our very own Oğuz left the only answer on the OP's Stack Overflow question, explaining that braced forms of the other compound commands would be syntactically ambiguous. https://stackoverflow.com/a/63261064 vq