Ticket #391 (closed defect: fixed)
Installing cabal: ./bootstrap.sh: pushd: not found (probably because of /bin/sh)
|Reported by:||guest||Owned by:|
|Cc:||Difficulty:||very easy (<1 hour)|
On Ubuntu, trying to install cabal using the "Quick Installation on Unix" instructions at here says
Setup: At least the following dependencies are missing: Cabal >=1.4&&<1.5, HTTP >=3000&&<3002, zlib >=0.4 ./bootstrap.sh: 24: popd: not found ./bootstrap.sh: 27: pushd: not found
and so on.
The reason is that bootstrap.sh has a "#!/bin/sh" shebang line, and pushd/popd are Bash extensions, not POSIX shell features, and Ubuntu uses dash, not bash, as /bin/sh (by default).
The fix is to make bootstrap.sh either not use Bash-specific extensions, or (easier) make the top line of bootstrap.sh say "#!/bin/bash" instead of "#!/bin/sh".
[It might be wise to make the same change in all other files that use Bash extensions; the tool "checkbashims" might be useful here.]