[Openmcl-devel] CCL startup script (ccl & ccl64) is not Bourne Shell compatible
Waldek Hebisch
hebisch at math.uni.wroc.pl
Sat Oct 10 09:45:06 PDT 2009
Chun Tian wrote:
> Hi, Clozure team
>
> CCL's startup script (ccl & ccl64) cannot run correctly under Solaris
> 10, because this two scripts is NOT Bourne Shell compatible and have
> #!/bin/sh as their first line. The problem is in following lines:
>
> if [ -z "$CCL_DEFAULT_DIRECTORY" -a -n "`which readlink`" ]; then
> dir="`readlink $0`"
> probe "${dir%/scripts/ccl64}"
> fi
>
> Here, the syntax "${dir%/scripts/ccl64}" is only support in GNU bash
> (Bourne Again Shell) but original "sh". Today, almost every OS have "/
> bin/sh" link to "/bin/bash" so that most users didn't notice this
> issue. But Solaris 10 still use the original "/bin/sh" which lack of
> support of that usage on shell variables.
>
The last paragraph is misleading: the "${dir%/scripts/ccl64}" construct
is in Posix shell specifiaction. It works on most Unix systems
simply because vensors ship standard compilant shells. Solaris
ships pre-standard Bourne shell, so it does not work. Advice to
require 'bash' goes in wrong direction -- several systems have
different shell as '/bin/sh' and do not ship bash in default
setup. So using 'bash' is likely to break several other systems.
AFAICS on Solaris correct fix is to replace '/bin/sh' by
'/bin/posix/sh'.
--
Waldek Hebisch
hebisch at math.uni.wroc.pl
More information about the Openmcl-devel
mailing list