Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-13 Thread Greg Wooledge
On Thu, Mar 12, 2009 at 05:05:33PM -0400, Gerard wrote: > #!/usr/bin/env bash > > if $(which gpg2); then >printf "gpg2 located" > fi The behavior of which(1) is not reliable across platforms. Since you're already using bash, you should consider using one of the bash builtins instead: if c

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Chet Ramey
Gerard wrote: > On Thu, 12 Mar 2009 16:17:45 -0400 > Chet Ramey wrote: > > [snip] > > It is now believed that the problem has to do with Yacc on FreeBSD. > There is an experimental patch just issued that substitutes 'bison' for > 'yacc'. It is being tested right now by some users. Bash-4.0 pars

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Gerard
On Thu, 12 Mar 2009 16:17:45 -0400 Chet Ramey wrote: [snip] It is now believed that the problem has to do with Yacc on FreeBSD. There is an experimental patch just issued that substitutes 'bison' for 'yacc'. It is being tested right now by some users. I can supply you a copy of the FreeBSD Make

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Chet Ramey
Gerard wrote: > Fair enough. I know that several users of FreeBSD are complaining all > ready and have switched back to Bash-3.x. > > This is a short script, named "t.sh" that will produce the error > message: > > #!/usr/bin/env bash > > if $(which gpg2); then >printf "gpg2 located" > fi >

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Gerard
On Thu, 12 Mar 2009 16:17:45 -0400 Chet Ramey wrote: >Gerard wrote: >> I just installed Bash-4 via the FreeBSD ports system. The >> installation went fine. However, all of my Bash scripts that use the >> $() syntax now fail with this error message: >> >> syntax error near unexpected ')' > >This

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Chet Ramey
Gerard wrote: > I just installed Bash-4 via the FreeBSD ports system. The installation > went fine. However, all of my Bash scripts that use the $() > syntax now fail with this error message: > > syntax error near unexpected ')' This isn't useful at all without an example I can use to reproduce t

Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Gerard
I just installed Bash-4 via the FreeBSD ports system. The installation went fine. However, all of my Bash scripts that use the $() syntax now fail with this error message: syntax error near unexpected ')' I have modified some of the scripts to use the older "`" tic method; however, that is not re