Petter Holt Juliussen • Mail | Mastodon | GitHub | Letterboxd

for later reference.

Shell

2019-04-04

The shell is a user interface for access to an operating system's services. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending on a computer's role and particular operation. It is named a shell because it is the outermost layer around the operating system kernel.

The Bourne shell (sh) was the default shell for Version 7 Unix. Most Unix-like systems continue to have /bin/sh — which will be the Bourne shell, or a symbolic link or hard link to a compatible shell — even when other shells are used by most users.

Bash

Bash (Bourne Again SHell) is a Unix shell and command language written by Brian Fox for the GNU Project as a free software replacement for the Bourne shell (1989). It has been distributed widely as the default login shell for most Linux distributions and Apple's macOS.

The Bash command syntax is a superset of the Bourne shell command syntax. Bash can execute the vast majority of Bourne shell scripts without modification. Bash command syntax includes ideas drawn from the Korn shell (ksh) and the C shell (csh) such as command line editing, command history, the directory stack, the $RANDOM and $PPID variables, and POSIX command substitution syntax $(…).

Bash's syntax has many extensions lacking in the Bourne shell. Bash can perform integer calculations ("arithmetic evaluation") without spawning external processes. It uses the ((…)) command and the $((…)) variable syntax for this purpose. Its syntax simplifies I/O redirection.

Bash is a POSIX-compliant shell, but with a number of extensions.

(D)ash

Almquist shell (also known as A Shell, ash and sh) is a lightweight Unix shell originally written by Kenneth Almquist in the late 1980s. Initially a clone of the System V.4 variant of the Bourne shell, it replaced the original Bourne shell in the BSD versions of Unix released in the early 1990s.

In 1997 Herbert Xu ported ash from NetBSD to Debian Linux focusing on POSIX conformance and slim implementation. In September 2002, with release 0.4.1, this port was renamed to dash (Debian Almquist shell). Because of its slimness, Ubuntu decided to adopt the dash as the default /bin/sh in 2006. Ash is also fairly popular in embedded Linux systems; its code was incorporated into the BusyBox catch-all executable often employed in this area, and is used in distributions like DSLinux, Alpine Linux, Tiny Core Linux and Linux-based router firmware such as OpenWrt, Tomato and DD-WRT.