bug-bash
[Top][All Lists]
Advanced

[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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]