Bash (Unix shell)
GNU replacement for the Bourne shell / From Wikipedia, the free encyclopedia
Dear Wikiwand AI, let's keep it short by simply answering these key questions:
Can you list the top facts and stats about Bash (Unix shell)?
Summarize this article for a 10 year old
Bash, short for Bourne-Again SHell, is a shell program and command language supported by the Free Software Foundation and first developed by Brian Fox for the GNU Project. Designed as a 100% free software alternative for the Bourne shell[15][16], it was initially released in 1989[17]. Its moniker is a play on words, referencing both its predecessor, the Bourne shell[18], and the concept of renewal[19][20].
Original author(s) | Brian Fox |
---|---|
Developer(s) | Chet Ramey[1][2] |
Initial release | June 8, 1989; 34 years ago (1989-06-08) |
Stable release | |
Repository | |
Written in | C |
Operating system | |
Platform | GNU |
Available in | Multilingual (gettext) |
Type | Unix shell, command language |
License | Since 4.0: GPL-3.0-or-later[10] 1.11? to 3.2: GPL-2.0-or-later[11] 0.99? to 1.05?: GPL-1.0-or-later[12][13][14] |
Website | www |
Since its inception, Bash has gained widespread adoption and is commonly used as the default login shell for numerous Linux distributions. It holds historical significance as one of the earliest programs ported to Linux by Linus Torvalds, alongside GCC (GNU Compiler Collection)[21]. It is available on nearly all modern operating systems, making it a versatile tool in various computing environments.
As a command processor, Bash operates within a text window where users input commands to execute various tasks. It also supports the execution of commands from files, known as shell scripts, facilitating automation. In keeping with Unix shell conventions, Bash incorporates a rich set of features, including:
- Interactive and non-interactive invocation
- Execution of:
- Command history, jobs / job control and tab completion in interactive mode
- A built-in "help" command, man page, and an info page
- Shell compatibility and portability (POSIX) modes
- Control structures for condition-testing and iteration
- UNIX-style pipelines
- Configurable execution environment(s)
- Command line parsing
- Quoting rules
- Parameters (or "variables"), arrays and associative arrays
- "Command," arithmetic and "process" substitutions
- "Word splitting"
- Filename expansion (globbing) and pattern matching
- Quote removal
- Command name lookup, including "aliases," "functions," shell built-ins and shell keywords
- Redirections of inputs, outputs and error data streams, including "here documents" and "here strings"
- Subshells
- Exit status codes
- Signaling as a means of inter-process communication
- Asynchronous execution
- ANSI-C quoting
- Brace and tilde expansions
- Configurable prompt and command line editing with GNU readline in interactive mode
- Shell and session startup files (dotfiles) such as '~/.bashrc'
- Various settings and shell options with the `set` and `shopt` built-ins
- Execution traces ("xtrace"): lightweight logging for debugging purposes
The keywords, syntax, dynamically scoped variables and other basic features of the language are all copied from sh. Other features, e.g., history, are copied from csh and ksh. Bash is a POSIX-compliant shell, but with a number of extensions.
A version is also available for Windows 10 and Windows 11 via the Windows Subsystem for Linux.[22][23] It is also the default user shell in Solaris 11.[24] Bash was also the default shell in BeOS,[7] and in versions of Apple macOS from 10.3 (originally, the default shell was tcsh) to 10.15 (macOS Catalina), which changed the default shell to zsh,[25] although Bash remains available as an alternative shell.[26]
A security hole in Bash dating from version 1.03 (August 1989),[27] dubbed Shellshock, was discovered in early September 2014 and quickly led to a range of attacks across the Internet.[28][29][30] Patches to fix the bugs were made available soon after the bugs were identified.