[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug: please document extended and alternate for loop syntax
|
From: |
John Wiersba |
|
Subject: |
Bug: please document extended and alternate for loop syntax |
|
Date: |
Fri, 7 Mar 2025 14:23:00 +0000 (UTC) |
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 mint virginia
(ubuntu jammy)
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)Bug: please document
this extended/alternate syntax for the for loop.See also my question at
https://unix.stackexchange.com/questions/792066/why-does-this-bash-for-loop-syntax-workand
some more information at
https://unix.stackexchange.com/questions/306940/what-is-the-purpose-of-the-do-keyword-in-bash-for-loops/306944#306944
Thanks!-- John Wiersba
- Bug: please document extended and alternate for loop syntax,
John Wiersba <=
- Re: Bug: please document extended and alternate for loop syntax, Chet Ramey, 2025/03/07
- Re: Bug: please document extended and alternate for loop syntax, John Wiersba, 2025/03/07
- Re: Bug: please document extended and alternate for loop syntax, Lawrence Velázquez, 2025/03/07
- Re: Bug: please document extended and alternate for loop syntax, Chet Ramey, 2025/03/10
- Re: Bug: please document extended and alternate for loop syntax, John Wiersba, 2025/03/10
- Re: Bug: please document extended and alternate for loop syntax, Chet Ramey, 2025/03/10
- Re: Bug: please document extended and alternate for loop syntax, John Wiersba, 2025/03/10
- Re: Bug: please document extended and alternate for loop syntax, Oğuz, 2025/03/10