Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #16729 > unrolled thread
| Started by | worley@alum.mit.edu (Dale R. Worley) |
|---|---|
| First post | 2020-08-06 22:29 -0400 |
| Last post | 2020-08-06 22:29 -0400 |
| Articles | 1 — 1 participant |
Back to article view | Back to gnu.bash.bug
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Undocumented for-loop construct worley@alum.mit.edu (Dale R. Worley) - 2020-08-06 22:29 -0400
| From | worley@alum.mit.edu (Dale R. Worley) |
|---|---|
| Date | 2020-08-06 22:29 -0400 |
| Subject | Re: Undocumented for-loop construct |
| Message-ID | <mailman.1068.1596767403.2739.bug-bash@gnu.org> |
Klaas Vantournhout <klaas.vantournhout@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, though I haven't
tried extending while/until and recompiling parse.y; maybe it doesn't
work.
Dale
Back to top | Article view | gnu.bash.bug
csiph-web