Generated by GPT-5-mini| Bash (Unix shell) | |
|---|---|
| Name | Bash |
| Author | Brian Fox |
| Developer | GNU Project |
| Released | 1989 |
| Operating system | Unix-like |
| Genre | Command shell |
| License | GNU General Public License |
Bash (Unix shell) is a Unix shell and command language widely used on Unix, Linux, macOS, and GNU systems. Developed as part of the GNU Project by Brian Fox and later maintained by Chet Ramey, it serves as a command interpreter for users and scripts, integrating features from the Bourne shell and the C shell family. Bash combines interactive features for terminal users with scripting facilities used by system administrators, developers, and projects across Debian, Red Hat, Ubuntu, and other distributions.
Bash originated in 1989 when Brian Fox implemented a free replacement for the Bourne shell for the GNU Project; later development involved Chet Ramey and contributors associated with FSF and GNU Savannah. Influences include the Bourne shell written by Stephen Bourne at AT&T Bell Labs, the C shell from Bill Joy at UC Berkeley, and the KornShell by David Korn at AT&T. Bash adoption grew with the rise of Linux distributions such as Slackware and Debian, and it became the default interactive shell on many systems including Red Hat Enterprise Linux and earlier versions of macOS until changes in 2019. Security incidents and audits by organizations like OpenBSD and projects supported by OWASP spurred fixes and feature changes over time.
Bash implements job control features present in the KornShell and C shell families and extends the Bourne shell syntax used in scripts for Debian, Fedora, SUSE, Arch Linux, and other distributions. Core design goals—set by GNU and contributors—include POSIX compatibility with extensions for command completion, history, programmable completion from Readline, and associative arrays influenced by ksh88. Features such as process substitution, brace expansion, shell arithmetic, and here-documents reflect design lineage from Plan 9 tools and AT&T research. Bash interacts with terminal drivers and pseudo-terminals provided by Linux kernel and FreeBSD, and integrates with utilities from GNU Core Utilities.
The syntax of the shell traces back to the Bourne syntax used in scripts deployed on SunOS, AIX, and HP-UX. Builtins include control structures (if, case, for, while), job control commands (fg, bg, jobs), and environment management (export, unset) used by administrators on Red Hat, Oracle Linux, and CentOS systems. Command substitution, pipelines, and redirection operators follow conventions established in UNIX V7 and extended in POSIX specifications endorsed by IEEE. Readline enables key bindings and history expansion compatible with editors like Emacs and Vi used by developers at Google, Microsoft, and Facebook.
Bash scripting supports variables, functions, and control flow used in automation at organizations such as NASA, CERN, and NASA Jet Propulsion Laboratory. Scripts leverage exit codes and traps to interact with init systems like systemd and legacy SysVinit, and are employed in CI/CD pipelines run by Jenkins, Travis CI, and GitLab CI. Advanced scripting uses arrays, associative arrays, and arithmetic evaluation influenced by ksh features; error handling and quoting concerns are relevant in contributions to projects hosted on GitHub and GitLab. Shell scripts commonly invoke tools from GNU Make, Autoconf, and CMake during build processes for software from projects like Linux kernel, GCC, and LibreOffice.
Bash implements many features of the POSIX shell specification maintained by IEEE and The Open Group, while providing extensions beyond POSIX for compatibility with scripts from KornShell and Bourne shell users. Portability concerns arise when scripts target environments like BusyBox or Alpine Linux where smaller shells such as ash are used. Differences between Bash versions and alternatives prompted adherence to standards by distributions including Debian and Fedora, and influenced shell selection in infrastructure by enterprises like IBM and Oracle for certification programs.
The canonical implementation is distributed by the GNU Project and maintained in repositories on platforms such as Savannah and mirrors on GitHub. Variants and alternative shells that share syntax or features include Dash, Zsh, KornShell, BusyBox ash, and the Plan 9 rc shell; derivatives appear in implementations for Cygwin, MSYS2, and Windows Subsystem for Linux distributions by Microsoft. Packaging and backports are handled by maintainers at Debian Project, Ubuntu, Red Hat and community projects like Homebrew for macOS.
System administrators use Bash for account provisioning, cron jobs, and startup scripts on servers managed by teams at Amazon Web Services, Google Cloud Platform, and Microsoft Azure. Typical administrative activities include script auditing, permission hardening guided by CIS benchmarks, and integration with configuration management tools like Ansible, Puppet, Chef, and SaltStack. Interactive users benefit from programmable completion, history recall, and prompt customization, while developers incorporate Bash into toolchains alongside GCC, LLVM, and editors such as Vim and Emacs.
Category:Unix shells Category:GNU Project software