# Bash

> Command language and shell of the GNU Project, for running programs and writing scripts.

- **Appeared:** 1989
- **Creators:** Brian Fox
- **Maintained by:** GNU Project, maintained by Chet Ramey
- **Type:** shell
- **Status:** stable
- **Born from:** In 1989 Brian Fox, an employee of the Free Software Foundation, began Bash as a free alternative to the Bourne shell for the GNU Project. The Bourne shell, sh, came from Steve Bourne at Bell Labs, and Bash was meant to stay compatible with it while adding the interactive features of the Korn shell (ksh) and the C shell (csh).
- **Reacts to:** sh, ksh
- **Trade-offs:** no memory model; no type system; interpreted; concurrency: none. Cost: It keeps the Bourne shell's quirks, quoting and grammar included, so old sh scripts still run and new ones inherit the dark corners.
- **Slots:** scripts ●●● strong; cli ●●● strong (Built for interactive use: job control, command-line editing and history.); server ●●○ ok; systems ○○○ none
- **Alternatives:** python, perl, ruby, awk
- **Won where:** GitHub Actions runs run: steps in bash on Linux and macOS runners by default [source](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions); GitLab Runner uses Sh/Bash as the default shell on Unix, with sh as the fallback [source](https://docs.gitlab.com/runner/shells/)
- **Timeline:** 1989: Brian Fox begins Bash for the GNU Project as a free alternative to the Bourne shell [source](https://pldb.io/concepts/bash.html); 1996: Bash 2.0 tarball is published on the GNU FTP server [source](https://ftp.gnu.org/gnu/bash/); 2009: Chet Ramey announces the first public release of bash-4.0 on the info-gnu list [source](https://lists.gnu.org/r/info-gnu/2009-02/msg00018.html); 2014: Shellshock, CVE-2014-6271, lets crafted environment variables run commands in Bash through 4.3 [source](https://ubuntu.com/security/CVE-2014-6271); 2019: Bash 5.0 tarball is published on the GNU FTP server [source](https://ftp.gnu.org/gnu/bash/); 2019: Apple announces zsh as the default shell in macOS 10.15 Catalina [source](https://www.scriptingosx.com/2019/06/moving-to-zsh/)
- **Links:** [website](https://www.gnu.org/software/bash/), [wikipedia](https://en.wikipedia.org/wiki/Bash_(Unix_shell)), [docs](https://tiswww.case.edu/php/chet/bash/bashtop.html)
- **PLDB:** https://pldb.io/concepts/bash.html
- **Sources:** https://pldb.io/concepts/bash.html, https://tiswww.case.edu/php/chet/bash/rose94.pdf, https://tiswww.case.edu/php/chet/bash/article.pdf, https://www.gnu.org/software/bash/, https://ftp.gnu.org/gnu/bash/, https://lists.gnu.org/r/info-gnu/2009-02/msg00018.html, https://ubuntu.com/security/CVE-2014-6271, https://www.scriptingosx.com/2019/06/moving-to-zsh/, https://support.apple.com/en-us/HT208050, https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions, https://docs.gitlab.com/runner/shells/, https://en.wikipedia.org/wiki/Bash_(Unix_shell)
- **Verified:** no, draft of 2026-10-30
- **Canonical:** https://langwhy.dev/lang/bash/

## Why it exists

In 1989 Brian Fox, who worked for the Free Software Foundation, wrote Bash as a free alternative to the Bourne shell for the GNU Project ([PLDB](https://pldb.io/concepts/bash.html)). The shell it replaced was sh, the direct ancestor of the Unix `/bin/sh`, written by Steve Bourne at Bell Labs ([Ramey](https://tiswww.case.edu/php/chet/bash/rose94.pdf)). Bash was meant to stay compatible with sh while borrowing the useful features of the Korn shell (ksh) and the C shell (csh), and the GNU Project's own description says it does exactly that ([GNU](https://www.gnu.org/software/bash/)). The most noticeable improvements over sh were for interactive use, such as job control, command-line editing and history ([Ramey](https://tiswww.case.edu/php/chet/bash/rose94.pdf)).

## What it trades away

Bash is an sh-compatible shell, so it keeps the Bourne shell's quirks. Its maintainer writes that the lesson repeated most often during Bash development is that the Bourne shell has dark corners and people use all of them, and that quoting and the grammar were poorly specified in the original Bourne shell description ([Ramey](https://tiswww.case.edu/php/chet/bash/article.pdf)). Scripts that look simple can therefore behave in ways their authors did not expect. Bash calls itself a command language interpreter, so it is the glue around programs rather than the place where most application code is written.

## Where it won

Bash is the default shell for scripts in several places where people never choose one. GitHub Actions runs `run:` steps in bash on Linux and macOS runners by default ([GitHub](https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions)). GitLab Runner uses Sh/Bash as the default shell on Unix systems, with sh as the fallback ([GitLab](https://docs.gitlab.com/runner/shells/)). It also shows where it lost ground: macOS 10.15 Catalina made zsh the default shell for new accounts, and Apple's support page says so directly ([Apple](https://support.apple.com/en-us/HT208050)). Bash has also been a security story, since the 2014 Shellshock bug let crafted environment variables run commands in Bash through version 4.3 ([Ubuntu](https://ubuntu.com/security/CVE-2014-6271)).

---
Data: CC0, https://github.com/langwhy/langwhy/blob/main/data/languages/bash.yaml
