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


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)