[Openmcl-devel] CCL startup script (ccl & ccl64) is not Bourne Shell compatible

Chun Tian binghe.lisp at gmail.com
Sat Oct 10 09:09:38 PDT 2009

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}"

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.

As a trivial fix, I suggest replacing the first line of above scripts  
from "#!/bin/sh" to "#!/bin/bash", that's what I did under Solaris 10  
right now (I also need to install a third-party "readlink" utility  
because Solaris 10 don't have it). I believe this small change won't  
cause any new issues for CCL users under other UNIX-line OS (Linux,  
Mac, FreeBSD, ...)


Chun Tian (binghe)

More information about the Openmcl-devel mailing list