[Geeks] bash/dash/sh mess

Alex Zijdenbos alex at bic.mni.mcgill.ca
Sat Apr 5 16:09:07 EDT 2008


Hello all,

I suspect I am not the first one to run into this so I was wondering
how others have dealt with this. Ubuntu uses dash as the default sh by
symlinking /bin/sh to /bin/dash, which breaks an awful lot of BIC/MINC
scripts which call #!/bin/sh as the interpreter. Mostly, dash does not
accept the use of '==', which then gives rise to errors like

   [: 37: ==: unexpected operator

this is for instance from Claude's pipeline install script; I also got
it for nu_correct and a bunch of other things. The explanation lives
in

   https://wiki.ubuntu.com/DashAsBinSh

where the suggestions are to either fix #!/bin/sh scripts ot be POSIX
compliant, or to change them to use #!/bin/bash, or to  'sudo
dpkg-reconfigure dash' to change the symlink (which appears to have
happened on the BIC systems).

Any thoughts/suggestions? Do a global search-and-replace through the
MINC codebase replacing #!/bin/sh to #!/bin/bash? Or fix the non-POSIX
stuff in them?

-- A


More information about the Geeks mailing list