Problem with Bash-4 and $(command) syntax

Eray Aslan eray.aslan at
Thu Mar 12 21:41:47 PDT 2009

On 13.03.2009 02:04, Mark McConnell wrote:
> On 12 Mar 2009 at 10:25, Jerry wrote:
> {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.


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.


> Like you, I wasn't able to find discussion of this on 
> the lists I subscribe to - although I'm sure it's going 
> on.  Looking through the diffs in 
> /usr/ports/distfiles/bash, the bracketed form of 
> command substitution appears to be a long-
> standing problem in bash40-xxx.  
> The back-tick `command` form works as it should, 
> but not the Posix-style $(command) form, as of 
> GNU bash, version 4.0.10(1)-release
> Mark
> --

More information about the freebsd-questions mailing list