Generated by GPT-5-mini| bash | |
|---|---|
| Name | Bash |
| Developer | Brian Fox, Chet Ramey |
| Released | 1989 |
| Programming language | C (programming language) |
| Operating system | Unix, Linux, Microsoft Windows, macOS |
| Genre | Shell |
| License | GNU General Public License |
bash Bash is a Unix shell and command language created as a free software replacement for earlier shells and widely used on Unix-like systems. It serves as an interactive command interpreter and an environment for scripting, integrating features from the Bourne shell lineage and later shells. Developers and system administrators rely on it across Linux distributions, macOS, FreeBSD, and Windows Subsystem for Linux installations for command execution, automation, and system management.
The project began in the late 1980s by Brian Fox for the GNU Project to provide a Bourne-compatible shell enriched with features found in C Shell and KornShell. Development continued with significant maintenance and enhancement by Chet Ramey, who added extensions and portability improvements. The shell displaced many legacy shells on Linux distributions and became the default on major systems, influencing shell design alongside Bourne shell, KornShell, and Z shell.
The shell implements job control, command-line editing, functions, and associative arrays, drawing inspiration from Bourne shell constructs and interactive features from Readline and Emacs/Vi editing modes. It supports filename globbing, process substitution, command substitution, and programmable completion integrated with GNU Readline and GNU History Library facilities. Shell built-ins provide I/O redirection, pipelines, and advanced parameter expansion behaviors used in administration tasks on Linux distributions, macOS, and BSD systems.
Command syntax combines simple utilities and pipelines common to Unix traditions, using control structures that echo constructs from Bourne shell and later influenced by POSIX specifications. Scripts employ shebang lines referencing interpreter paths in Filesystem Hierarchy Standard-compliant layouts on Linux distributions and Unix systems. Quoting rules, expansion order, and exit statuses follow conventions familiar to users migrating from sh-style environments and to those adopting automation patterns from Perl and Python ecosystems.
A comprehensive set of built-ins manages shell state and process control, including job, alias, and function manipulation familiar to admins from System V and BSD traditions. Special parameters and environment variables interact with inheritance semantics used by POSIX-compliant shells and tools such as cron, systemd, and login utilities on Linux distributions. The integration with signal handling, trap mechanisms, and internal arrays supports complex workflows seen in provisioning systems like Ansible and configuration management tools historically influenced by shell scripting.
The language is widely used to write initialization scripts, installation routines, and automation glue that orchestrates utilities such as awk, sed, grep, and tar. Script idioms leverage exit codes and conditional constructs to integrate with init systems including systemd and traditional init scripts on Linux distributions and Unix servers. Advanced users embed here-documents, process substitution, and coprocesses when constructing pipelines for continuous integration services and deployment pipelines used by Debian, Red Hat, and cloud provider toolchains.
Compatibility considerations involve adherence to POSIX specifications and divergence where extensions provide extra functionality beyond POSIX sh semantics. Portability advice often references behavior differences across implementations on GNU/Linux, macOS, and BSD platforms, and the need to target minimum-conformant subsets when writing cross-platform scripts for projects like Debian packaging or cross-compiling toolchains. Standards efforts and interoperability testing with utilities from GNU Core Utilities and other userland components shape expectations for script behavior.
The primary implementation is maintained within the GNU Project sources, while alternative shells such as Dash, KornShell, and Z shell offer differing trade-offs in performance and features. Extensions and integrations include completion scripts packaged by distributions like Debian and Red Hat Enterprise Linux, and third-party projects that provide enhanced editing and plugin ecosystems similar to those found in Emacs and Vim. Ports and compatibility layers enable use on Microsoft Windows through Cygwin and Windows Subsystem for Linux, and on embedded systems via cross-compiled builds used in OpenWrt and lightweight Linux images.
Category:Shells