Re: Parsing error when "case" in "for" in $()

2012-09-12 Thread Chet Ramey
On 9/11/12 10:50 AM, Benoit Vaugon wrote: > Description: > Cannot use "case" construction in a "for" loop in a $() sub shell. > Should work but produces parsing error. > > Repeat-By: > echo $(for x in whatever; do case y in *) echo 42;; esac; done) Thanks for the report. This will be fixe

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Dan Douglas
On Tuesday, September 11, 2012 05:31:36 PM Steven W. Orr wrote: > On 09/11/12 17:20, quoth Chris F.A. Johnson: > > On Tue, 11 Sep 2012, Benoit Vaugon wrote: > > ... > >> Description: > >> Cannot use "case" construction in a "for" loop in a $() sub shell. > >> Should work but produces parsing erro

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Eric Blake
On 09/11/2012 03:31 PM, Steven W. Orr wrote: >>> Fix: >>> Probably by fixing the bash parser. >> >> Balance the parentheses in the case statement: >> >> echo $(for x in whatever; do case y in (*) echo 42;; esac; done) >> > > Thanks. I didn't know that the opening paren was optional and was ne

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Eric Blake
On 09/11/2012 08:50 AM, Benoit Vaugon wrote: > Bash Version: 4.1 > Patch Level: 7 > Repeat-By: > echo $(for x in whatever; do case y in *) echo 42;; esac; done) The syntax error is still present in bash 4.2 patchlevel 37: $ echo $(for x in whatever; do case y in *) echo 42;; esac; done) bash

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Steven W. Orr
On 09/11/12 17:20, quoth Chris F.A. Johnson: On Tue, 11 Sep 2012, Benoit Vaugon wrote: ... Description: Cannot use "case" construction in a "for" loop in a $() sub shell. Should work but produces parsing error. Repeat-By: echo $(for x in whatever; do case y in *) echo 42;; esac; done)

Re: Parsing error when "case" in "for" in $()

2012-09-11 Thread Chris F.A. Johnson
On Tue, 11 Sep 2012, Benoit Vaugon wrote: ... Description: Cannot use "case" construction in a "for" loop in a $() sub shell. Should work but produces parsing error. Repeat-By: echo $(for x in whatever; do case y in *) echo 42;; esac; done) The closing parentheses in the case statement i

Parsing error when "case" in "for" in $()

2012-09-11 Thread Benoit Vaugon
Configuration Information [Automatically generated, do not change]: Machine: i386 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' -DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPA