One of the things I often do on FreeBSD machines is to install
shells/bash and work most of the time with a bourne-compatible shell.
/bin/csh shell is mostly ok for short interactive sessions, but I can’t stand its command-syntax for semi-complex looping, iteration or other combined commands. So install bash or mksh and I launch one of them from my login prompt, using something like:
csh# env SHELL=/usr/local/bin/bash /usr/local/bin/bash -l bash#
There’s a minor catch with
SHELL being set to
/usr/local/bin/bash though. The default binary of bash is dynamically linked, and it depends on
libintl.so.XXX from the
devel/gettext package. This means that if you happen to run a package update command that rebuilds
gettext from source, there is a small period between the time the old
gettext is uninstalled and the new version is installed that the following are all true:
- Your current
SHELLpoints to bash
- The bash binary needs
libintl.so.XXXto run, so it (temporarily) fails with a runtime linker error
- The “
configure” script of the
gettextsources thinks that configure-time checks can use your current
So you cannot upgrade
gettext, and your current shell needs it to run. Any other packages that depend on
gettext cannot be upgraded either. Not a very nice corner to paint yourself into…
There are, however, at least three options to recover from a mess like this:
- Run a shell that is statically linked version of bash. The
shells/bashport of FreeBSD can build a statically linked version of the shell when
WITH_STATIC_BASHis set at build-time.
shells/mkshas a temporary shell to reinstall the broken packages, e.g.
gettextand any other package that depends on it.
CONFIG_SHELLto a shell that works even without
/bin/shshell of FreeBSD should work fine for this), or to one that has minimal library dependencies (the
/usr/local/bin/mkshshell only depends on
libc.so.Xon FreeBSD, so it should work fine too).