Re: $() parsing still broken

2009-09-20 Thread Jan Schampera

Hey Chet,

I can reproduce it. What can I do to help tracking it down?

bon...@core:~/devel/bash-4.0$ ./bash -c 'echo $(echo \|)'
./bash: command substitution: line 1: syntax error near unexpected token `)'
./bash: command substitution: line 1: `echo \|)'
bon...@core:~/devel/bash-4.0$ ./bash -c 'echo $BASH_VERSION'
4.0.33(1)-release


Jan aka TheBonsai





Re: $() parsing still broken

2009-09-20 Thread Andreas Schwab
Jan Schampera jan.schamp...@web.de writes:

 I can reproduce it. What can I do to help tracking it down?

Make sure the parser was regenerated after applying patch 1.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.




Re: $() parsing still broken

2009-09-20 Thread Christian Weisgerber
Chet Ramey:

 I suppose the only real variable is the revision of bison:

2.4.1 and 2.3 on my FreeBSD and OpenBSD box, respectively.

-- 
Christian naddy Weisgerber  na...@mips.inka.de




Re: $() parsing still broken

2009-09-20 Thread Chet Ramey
Christian Weisgerber wrote:
 Chet Ramey:
 
 I suppose the only real variable is the revision of bison:
 
 2.4.1 and 2.3 on my FreeBSD and OpenBSD box, respectively.

Try 1.875 and see if the problems go away.  That version worked
for me on FreeBSD; my Mac OS X boxes use 2.0

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




Re: $() parsing still broken

2009-09-20 Thread Christian Weisgerber
Chet Ramey:

  I suppose the only real variable is the revision of bison:
  
  2.4.1 and 2.3 on my FreeBSD and OpenBSD box, respectively.
 
 Try 1.875 and see if the problems go away.

Red herring.  I found the problem, it is embarrassingly stupid, and
Andreas was right.  The fault lies with the official FreeBSD and
OpenBSD ports.

Since bash 4's $() parsing is broken if you build the parser with
BSD yacc, the ports now specify the use of bison by passing YACC=bison
to the configure script.  Running bison -d parse.y creates
parse.tab.c rather than y.tab.c, so y.tab.c is never regenerated,
and the parser fix from patch 001 is effectively not applied.

We just need to use YACC=bison -y.

-- 
Christian naddy Weisgerber  na...@mips.inka.de




Re: $() parsing still broken

2009-09-20 Thread Jan Schampera

Jan Schampera schrieb:

It was a fresh install. Unpacking source + applying pathces, then 
build *scratches beard*.


And it was done without bison - my bad. Works now.

Jan





Re: $() parsing still broken

2009-09-19 Thread Andreas Schwab
Christian Weisgerber na...@mips.inka.de writes:

 Even in the latest bash, 4.0.33, $() parsing is still broken:

 $ bash -c 'echo $(echo \|)'
 bash: -c: line 0: unexpected EOF while looking for matching `)'
 bash: -c: line 1: syntax error: unexpected end of file

This has been fixed with patch 1, are you sure you are running the
patched version?

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
And now for something completely different.




Re: $() parsing still broken

2009-09-19 Thread Chet Ramey
Christian Weisgerber wrote:
 Even in the latest bash, 4.0.33, $() parsing is still broken:
 
 $ bash -c 'echo $(echo \|)'
 bash: -c: line 0: unexpected EOF while looking for matching `)'
 bash: -c: line 1: syntax error: unexpected end of file
 
 And yes, this is bash built with GNU bison, not Berkeley yacc.

The rest of the information from bashbug would help, since I can't
reproduce it:

local(1)$ ./bash
local(2)$ echo $BASH_VERSION
4.0.33(6)-release
local(2)$ ./bash --version
GNU bash, version 4.0.33(6)-release (i386-apple-darwin9.6.0)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
local(2)$ ./bash -c 'echo $(echo \|)'
|
local(2)$ ./bash ./x3
|
local(2)$ cat x3
./bash -c 'echo $(echo \|)'
local(2)$ ./bash ./x3a
|
local(2)$ cat x3a
echo $(echo \|)


-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/