sh

The standard Unix shell name: whatever program /bin/sh points to, expected to behave as the POSIX standard describes.

In more detail

The original sh was the Bourne shell; today /bin/sh is a link to some shell that follows the POSIX rules. On Debian and Ubuntu it is dash, on Alpine it is ash from BusyBox, and on macOS it is bash 3.2 running in its POSIX mode. A script whose shebang says sh must avoid bash-only features, because the shell that actually runs it may not have them.

Example

sudo sh -c 'echo /opt/homebrew/bin/bash >> /etc/shells'

Related terms

Taught in

References