Change the /bin/sh symlink on Ubuntu systems to point to the dash shell instead of the current bash shell.


Our default shell is currently bash, which is slow and very large as it is intended as a user login shell. While this is good for users, it is not the best shell for running shell scripts; there are far smaller and faster shells that provide POSIX compliance such as dash.

By changing the /bin/sh symlink from bash to dash we can have the best of both worlds.

Use cases

  • Matthias is a software developer of an application whose shell configure script is very long, dash is able to execute it orders of magnitude faster than bash. (OpenOffice.org's configure scripts runs two and a half minutes quicker).

  • Jane is a user whose old laptop takes a long time to boot, dash is able to execute the shell init scripts much faster than bash. (The boot is 30s faster).

  • Lianne is developing an embedded system with low memory and space requirements, Ubuntu is a more attractive base as it uses a 79K shell binary instead of a 649K one.


This specification is limited to changing which shell which is provided by /bin/sh, the shell executed by scripts claiming POSIX compliance.

Scripts not claiming POSIX compliance are already required to use a different shell, such as /bin/bash.

The default user shell (that set by adduser) would remain as /bin/bash, as would the shell of existing accounts including root.


The dash package is already able to takeover the /bin/sh symlink and divert the one provided by the bash package, this is currently performed as a result of a debconf question the default answer of which is false.

We would set the default answer of this to true and place dash into the minimal seed.

Data preservation and migration

No user accounts or existing scripts need to be changed.

As the symlink is adjustable via a debconf question, any users who do not wish to have a POSIX shell as the default can run dpkg-reconfigure dash and restore bash.

Fortunately a "POSIX compliance" audit of shell scripts has already taken place in Debian some time ago, mostly as a result of Nokia using dash on their Internet Tablet device. We expect very few breakages as a result of changing the default shell, and those we find can be trivially patched or the script changed to use /bin/bash.


DashAsBinSh/Spec (last edited 2008-08-06 16:22:08 by localhost)