Re: Bug: please document extended and alternate for loop syntax

2025-03-07 Thread John Wiersba via Bug reports for the GNU Bourne Again SHell
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

Bug: please document extended and alternate for loop syntax

2025-03-07 Thread John Wiersba via Bug reports for the GNU Bourne Again SHell
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

Re: Bug: please document extended and alternate for loop syntax

2025-03-07 Thread John Wiersba via Bug reports for the GNU Bourne Again SHell
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

Re: Bug: please document extended and alternate for loop syntax

2025-03-10 Thread John Wiersba via Bug reports for the GNU Bourne Again SHell
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

Re: Bug: please document extended and alternate for loop syntax

2025-03-10 Thread John Wiersba via Bug reports for the GNU Bourne Again SHell
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

Re: Bug: please document extended and alternate for loop syntax

2025-03-11 Thread John Wiersba via Bug reports for the GNU Bourne Again SHell
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)