Andrew Mercer
on this page

The Debian Almquist shell is a small, fast, POSIX-focused descendant of the BSD ash. Debian and Ubuntu use it as /bin/sh because boot and package-maintainer scripts run several times faster than under bash. It is a scripting shell, not an interactive one: it has no tab completion and only minimal line editing.

What bash users trip over, beyond the general list in Portable equivalents of common bashisms:

  • echo always interprets backslash escapes and has no -e. Use printf.
  • source doesn't exist. Use ..
  • No $RANDOM, process substitution, or &>.
  • set -o pipefail was only standardised in POSIX.1-2024, and older dash releases don't support it.

local does work in dash even though POSIX doesn't define it.

Useful commands

dash -n script.sh                         # parse-only syntax check under dash
sudo dpkg-reconfigure dash                # Debian/Ubuntu: choose whether /bin/sh is dash or bash

Fedora and RHEL also package dash (dnf install dash), which makes it easy to test script portability on a system where /bin/sh is bash.

Further reading