Problem with Bash-4 and $(command) syntax
gesbbb at yahoo.com
Fri Mar 13 03:25:06 PDT 2009
> From: bf bf2006a at yahoo.com
> The problem is that the port's parser is
> broken, owing in part to incompatibilities between the
> system yacc currently used to build the parser and GNU
> bison, which is used by the people who write bash. This
> is true of both shells/bash and shells/bash3, but is more
> noticeable in shells/bash. A fix has been proposed, and patches
> are available, in the follow-up to:
> The port's maintainer has been reluctant to switch to bison,
> so this may not be the solution that is ultimately used to
> fix the port, but you can use these in the meantime.
I just received a reply back from the 'bash-bugs' forum.
Chet Ramey <chet.ramey at case.edu>
Bash-4.0 parses the contents of command substitutions before
executing them. This is what Posix requires. Previous versions
deferred parsing to the subshell spawned to execute the command.
(This part works best if you're looking at the yacc grammar.)
BSD yacc will not reduce a simple_list1 to a simple_list when the
lookahead token is `)'. Bison will. It's that simple.
More information about the freebsd-ports