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 only exists for compatibility with historical versions of the Bourne shell (where it is likewise undocumented). Its use is not encouraged, and POSIX doesn't specify it, so it's not portable. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/
OpenPGP_signature.asc
Description: OpenPGP digital signature