src/version.sh should explicitely declare to use bash

Matthias Andree matthias.andree at gmx.de
Sat Nov 15 15:43:32 CET 2003


Naoya Maruyama <naoya at matsulab.is.titech.ac.jp> writes:

> I just downloaded the bogofilter v0.15.8, and tried to compile. But the
> compilation failed due to an error in src/version.sh. On my Solaris, the
> execution of the shell script fails reporting the following error:
>
> ./version.sh: syntax error at line 19: `VERSION=$' unexpected
>
> And the line is:
>
> VERSION=$(grep define.VERSION config.h | awk '{print $3}' | tr -d '"')
>
> I believe the above statement isn't valid in sh, but it's one of the
> extensions by bash. Thus the first line of the script should be
> "#!bin/bash", not "#!/bin/sh". Actually, after changing the line as such,
> the entire compilation finished without any errors.
>
> So, I think the script shoud explicitly declare to use bash, not sh. 

I should give a final report, I changed configure.ac to search for a
somewhat POSIX-compliant bash. Sun have refused to align their /bin/sh
to standards for some bogus compatibility reasons, and their /bin/sh is
pretty incompatible with other systems.

Bogofilter will try several shells, /bin/sh /usr/xpg4/bin/sh /bin/ksh
/bin/bash /usr/local/bin/bash, in this order, and pick the first that
supports $() command expansion. Expect this in the next version of
bogofilter.

Until then, please try if "env SHELL=/bin/ksh ./configure" works around
your problem.

-- 
Matthias Andree

Encrypt your mail: my GnuPG key ID is 0x052E7D95




More information about the bogofilter-dev mailing list