Problem with Bash-4 and $(command) syntax

bf bf2006a at yahoo.com
Thu Mar 12 22:35:33 PDT 2009



> > {Problem with Bash-4 and $(command) ...}:
> [...]
> > I found the same problem, and have reverted to
> >  bash3.2 until it's sorted out. 
>
> See if the following helps.
>
> http://tiswww.case.edu/php/chet/bash/COMPAT
>
> Especially:
>
> 38. Since bash-4.0 now follows Posix rules for finding the 
> closing
> delimiter of a $() command substitution, it will not behave as > previous
> versions did, but will catch more syntax and parsing errors 
> before
> spawning a subshell to evaluate the command substitution.
>
> -- 
>Eray

Yes, the above is true.  But many of the examples cited
by people noticing this problem are perfectly valid and
_should_ work.  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:

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=ports/101230

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.

Regards,
            b.


      


More information about the freebsd-questions mailing list