Thanks, Greg!!!
On Friday, March 7, 2025 at 01:19:28 PM EST, Greg Wooledge
wrote:
On Fri, Mar 07, 2025 at 17:23:57 +, John Wiersba via Bug reports for the
GNU Bourne Again SHell wrote:
> - Is our conversation being recorded somewhere in the gnu archives, so
>that I can l
In all versions of bash since 2001 (e.g. 5.1.16(1)-release), the following
syntax works but is not documented:$ for (( i=0; i<3; ++i )) { echo $i; }
0
1
2
The manpage only lists this syntax: for (( expr1 ; expr2 ; expr3 )) ; do list
; done$ bash --version | head -1 # on a Dell desktop, linux
M, John Wiersba via Bug reports for the GNU Bourne Again
SHell wrote:
> In all versions of bash since 2001 (e.g. 5.1.16(1)-release), the following
> syntax works but is not documented:$ for (( i=0; i<3; ++i )) { echo $i; }
> 0
> 1
> 2
The group command as loop body syntax o
Thanks, Chet!
Yes, you're right that zsh definitely does not encourage use of these
non-standard constructs.
This whole thread got started when I accidentally created a mashup of
shell/perl, similar to:
for (( i=0; i<3; ++i )) { echo $i; }
and was really quite surprised to find that i
On Monday, March 10, 2025 at 12:38:38 PM EDT, Zachary Santer
wrote:
> Another alternative would be for bash to print a warning whenever it
> encounters this syntax.
There are precedents for this kind of behavior in languages like perl which
issue warnings
for deprecated features for several rel
I guess we could approach this topic a different way (the statements below are
just my guesses and not based on any particular insight I have into the history
of this syntax):
1) If this alternate syntax is not actively supported, then that could be
stated as the reason why it is not (further)