Problem with Bash-4 and $(command) syntax

GESBBB gesbbb at
Fri Mar 13 02:59:52 PDT 2009

> From: bf <bf2006a at>
> > > {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.
> >
> >
> >
> > 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:
> 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.

Until a fix has been put in place, I would suggest that a notice be placed in UPDATING that Bash-4 is not completely functional and its use is not recommended. Better yet, maybe the port should just be marked "BROKEN", since it clearly is. I personally would never have installed it had I been aware of the problems it is causing.  IMHO, it should have been tested more completely before being released into the ports system.


More information about the freebsd-ports mailing list