[cs615asa] HW2

Jan Schaumann jschauma at cs.stevens.edu
Wed Feb 23 11:23:03 EST 2011


Darren Alton <dalton at stevens.edu> wrote:
 
> root at ip-xxx-xxx-xxx-xxx:~/pkgsrc/bootstrap# ./bootstrap
> ERROR: Your shell's echo command is not BSD-compatible.
> ERROR: Please select another shell by setting the environment
> ERROR: variable SH.
> 
> Apparently Ubuntu's version of bash is screwy?

Not quite.  Bash on Ubuntu is as screwy as bash is anywhere else.  What
the bootstrap script is looking for is a shell that has a reasonable
approximation of POSIX compliance.  It will attempt to use /bin/sh, but
as the bootstrap script tells you:

bootstrap_sh=${SH-/bin/sh}
bootstrap_sh_set=${SH+set}

# On some newer Ubuntu installations, /bin/sh is a symlink to /bin/dash,
# whose echo(1) is not BSD-compatible.
dash_echo_test=`$bootstrap_sh -c 'echo "\\100"'`
if [ "$dash_echo_test" = "@" ]; then
        { echo "ERROR: Your shell's echo command is not BSD-compatible."
          echo "ERROR: Please select another shell by setting the environment"
          echo "ERROR: variable SH."
        } 1>&2
        exit 1;
fi


You can get around this by running:

env SH=/bin/bash ./bootstrap


For more on the discussion about Ubuntu using 'dash':
https://bugs.launchpad.net/ubuntu/+source/dash/+bug/141481
https://wiki.ubuntu.com/DashAsBinSh

(Yes, the funny part is that 'dash' pretends to be more POSIX compliant
than, for example, bash (which does have all sorts of weird extensions),
but in the process fails at some of them, apparently breaking a number
of things left and right.  Remember what I say about all software?)

-Jan


More information about the cs615asa mailing list