Re: [bug] Command substitutions within C-style for loops. Semicolon caus
From:
Chet Ramey
Subject:
Re: [bug] Command substitutions within C-style for loops. Semicolon causes error.
Date:
Sat, 29 Oct 2011 21:56:08 -0400
User-agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:7.0.1) Gecko/20110929 Thunderbird/7.0.1
On 10/29/11 1:21 AM, Dan Douglas wrote:
> It seems the Bash parser can't distinguish between the semicolon as a
> command separator list operator, and the arithmetic context delimiter of
> the C-style for loop. I realize this construct isn't particularly useful.
> ksh93 and zsh handle it as expected, but in Bash it causes a syntax error
> on my system.
Thanks for the report. The code that creates the three parts of the
arithmetic for loop is pretty naive; I'm not surprised that it doesn't
handle this right. It will be fixed in the next release of bash.
Chet
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/