Information about Bash
This article is about the Unix shell. For other uses, see Bash (disambiguation).
| Bash | |
| | |
Screenshot of a bash session demonstrating some features | |
| Developer: | Chet Ramey |
|---|---|
| Latest release: | 3.2.25 / 22 August 2007 |
| OS: | Cross-platform |
| Platform: | Cross-platform |
| Available language(s): | ? |
| Status: | ? |
| Genre: | Unix shell |
| License: | GNU General Public License |
| Website: | Official website |
Bash is a Unix shell written for the GNU Project. The name of the actual executable is bash. Its name is an acronym for Bourne-again shell, a pun on the name of the Bourne shell (sh) (i.e. "Bourne again" or "born again"), an early and important Unix shell written by Stephen Bourne and distributed with Version 7 Unix circa 1978. Bash was created in 1987 by Brian Fox. In 1990 Chet Ramey became the primary maintainer.
Bash is the default shell on most Linux systems as well as on Mac OS X and it can be run on most Unix-like operating systems. It has also been ported to Microsoft Windows within the Cygwin POSIX emulation environment for Windows, to MS-DOS by the DJGPP project and to Novell NetWare. Released under the GNU General Public License, Bash is free software.
Features
The Bash command syntax is a superset of the Bourne shell command syntax. The vast majority of Bourne shell scripts can be executed by Bash without modification, with the exception of Bourne shell scripts referencing a Bourne special variable or those using builtin Bourne commands. 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: $(...). When used as an interactive command shell and pressing the tab key, Bash automatically completes partly typed program names, filenames, variable names, etc.Bash's syntax has many extensions which the Bourne shell lacks. Several are enumerated here.
Bash can perform integer calculations without spawning external processes, unlike the Bourne shell. Bash uses the ((...)) command and the $[...] variable syntax for this purpose.
Bash syntax simplifies I/O redirection in ways which are not possible in the traditional Bourne shell. For example, Bash can redirect standard output and standard error at the same time using the following syntax.
> command >& file
This is simpler to type than the Bourne shell equivalent 'command > file 2>&1'.
Bash supports here documents just as the Bourne shell always has. However, since version 2.05b Bash can redirect standard input from a "here string" using the following syntax.
> command <<< "string to be read as standard input"
Bash 3.0 supports in-process regular expression matching using the following syntax, reminiscent of Perl:
> string =~ regex
The regular expression syntax is the same as that documented by the regex(7)[1] man page.
Startup scripts
When Bash starts, it executes the commands in a variety of different scripts.When Bash is invoked as an interactive login shell, it first reads and executes commands from the file /etc/profile, if that file exists. After reading that file, it looks for ~/.bash_profile, ~/.bash_login, and ~/.profile, in that order, and reads and executes commands from the first one that exists and is readable.
When a login shell exits, Bash reads and executes commands from the file ~/.bash_logout, if it exists.
When an interactive shell that is not a login shell is started, Bash reads and executes commands from ~/.bashrc, if that file exists. This may be inhibited by using the --norc option. The --rcfile file option will force Bash to read and execute commands from file instead of ~/.bashrc.
When Bash is started non-interactively, to run a shell script, for example, it looks for the variable BASH_ENV in the environment, expands its value if it appears there, and uses the expanded value as the name of a file to read and execute. Bash behaves as if the following command were executed:
> if [ -n "$BASH_ENV" ]; then . "$BASH_ENV"; fi
but the value of the PATH variable is not used to search for the file name.
If Bash is invoked with the name sh, it tries to mimic the startup behavior of historical versions of sh as closely as possible, while conforming to the POSIX standard as well. When invoked as an interactive login shell, or a non-interactive shell with the --login option, it first attempts to read and execute commands from /etc/profile and ~/.profile, in that order. The --noprofile option may be used to inhibit this behavior. When invoked as an interactive shell with the name sh, Bash looks for the variable ENV, expands its value if it is defined, and uses the expanded value as the name of a file to read and execute. Since a shell invoked as sh does not attempt to read and execute commands from any other startup files, the --rcfile option has no effect. A non-interactive shell invoked with the name sh does not attempt to read any other startup files. When invoked as sh, Bash enters POSIX mode after the startup files are read.
When Bash is started in POSIX mode, as with the --posix command line option, it follows the POSIX standard for startup files. In this mode, interactive shells expand the ENV variable and commands are read and executed from the file whose name is the expanded value. No other startup files are read.
Bash attempts to determine when it is being run by the remote shell daemon, usually rshd. If Bash determines it is being run by rshd, it reads and executes commands from ~/.bashrc, if that file exists and is readable. It will not do this if invoked as sh. The --norc option may be used to inhibit this behavior, and the --rcfile option may be used to force another file to be read, but rshd does not generally invoke the shell with those options or allow them to be specified.
Portability
Shell scripts written with Bash-specific features—bashisms—will not function on a system using the Bourne shell or one of its replacements, unless bash is installed as a secondary shell and the script is changed to begin with #!/bin/bash.See also
External links
- Bash (GNU project page)
- Bash Reference Manual
Bash can have different meanings; some usage cleverly combines different meanings.
Computing:
..... Click the link for more information.
Computing:
- bash, a Unix command shell written for the GNU project
- Bash.
..... Click the link for more information.
Software development is the translation of a user need or marketing goal into a software product.[1][2] Software development is sometimes understood to encompass the processes of software engineering combined with the research and goals of software marketing
..... Click the link for more information.
..... Click the link for more information.
Chet Ramey is the current maintainer of the GNU Bourne Again Shell. He is a longtime employee of Case Western Reserve University, from which he also received his B.S. in Computer Engineering and Master's degree in Computer Science.
..... Click the link for more information.
..... Click the link for more information.
Code complete redirects here. For the Microsoft book, see Code Complete.
A software release is the distribution, whether public or private, of an initial or new and upgraded version of a computer software product.
..... Click the link for more information.
A software release is the distribution, whether public or private, of an initial or new and upgraded version of a computer software product.
..... Click the link for more information.
August 22 is the 1st day of the year (2nd in leap years) in the Gregorian calendar. There are 0 days remaining.
..... Click the link for more information.
Events
- 392 - Arbogast has Eugenius elected Western Roman Emperor.
..... Click the link for more information.
20th century - 21st century - 22nd century
1970s 1980s 1990s - 2000s - 2010s 2020s 2030s
2004 2005 2006 - 2007 - 2008 2009 2010
2007 by topic:
News by month
Jan - Feb - Mar - Apr - May - Jun
..... Click the link for more information.
1970s 1980s 1990s - 2000s - 2010s 2020s 2030s
2004 2005 2006 - 2007 - 2008 2009 2010
2007 by topic:
News by month
Jan - Feb - Mar - Apr - May - Jun
..... Click the link for more information.
An operating system (OS) is the software that manages the sharing of the resources of a computer. An operating system processes system data and user input, and responds by allocating and managing tasks and internal system resources as a service to users and programs of the
..... Click the link for more information.
..... Click the link for more information.
Cross-platform is a term which can refer to computer programs, operating systems, computer languages, programming languages, or other computer software and their implementations which can be made to work on multiple computer platforms.
..... Click the link for more information.
..... Click the link for more information.
In computing, a platform describes some sort of framework, either in hardware or software, which allows software to run. Typical platforms include a computer's architecture, operating system, or programming languages and their runtime libraries.
..... Click the link for more information.
..... Click the link for more information.
Cross-platform is a term which can refer to computer programs, operating systems, computer languages, programming languages, or other computer software and their implementations which can be made to work on multiple computer platforms.
..... Click the link for more information.
..... Click the link for more information.
In the philosophy of language, a natural language (or ordinary language) is a language that is spoken, written, or signed (visually or tactilely) by humans for general-purpose communication, as distinguished from formal languages (such as computer-programming
..... Click the link for more information.
..... Click the link for more information.
Computer software can be organized into categories based on common function, type, or field of use. A list follows of common software categories.
..... Click the link for more information.
Categories of software
- Applications
..... Click the link for more information.
Unix shell, also called "the command line", provides the traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering command input as text for a shell to execute.
..... Click the link for more information.
..... Click the link for more information.
A software license comprises the permissions, rights and restrictions imposed on software (whether a component or a free-standing program). Use of software without a license could constitute infringement of the owner's exclusive rights under copyright or, occasionally, patent law
..... Click the link for more information.
..... Click the link for more information.
GNU General Public License
Author: Free Software Foundation
Version: 3
Copyright on the license: Free Software Foundation, Inc.
Publication date: 29 June 2007
OSI approved: Yes
Debian approved: Yes
Free Software:
..... Click the link for more information.
Author: Free Software Foundation
Version: 3
Copyright on the license: Free Software Foundation, Inc.
Publication date: 29 June 2007
OSI approved: Yes
Debian approved: Yes
Free Software:
..... Click the link for more information.
A website (alternatively, Web site or web site) is a collection of Web pages, images, videos or other digital assets that is hosted on one or several Web server(s), usually accessible via the Internet, cell phone or a LAN.
..... Click the link for more information.
..... Click the link for more information.
Unix shell, also called "the command line", provides the traditional user interface for the Unix operating system and for Unix-like systems. Users direct the operation of the computer by entering command input as text for a shell to execute.
..... Click the link for more information.
..... Click the link for more information.
The GNU Project is a free software, mass collaboration project, announced in 1983 by Richard Stallman. It initiated the GNU operating system, software development for which began in January 1984. GNU is a recursive acronym that stands for "GNU's Not Unix".
..... Click the link for more information.
..... Click the link for more information.
Acronyms and initialisms are abbreviations, such as NATO, laser, and IBM, that are formed using the initial letters of words or word parts in a phrase or name.
..... Click the link for more information.
..... Click the link for more information.
A pun (or paronomasia) is a phrase that deliberately exploits confusion between similar words for rhetorical effect, whether humorous or serious. For example, the sentence "the world is perspiring against me" is a pun on the paranoid's motto "
..... Click the link for more information.
..... Click the link for more information.
The Bourne shell, or sh, was the default Unix shell of Unix Version 7, and replaced the Thompson shell, whose executable file had the same name, sh. It was developed by Stephen Bourne, of AT&T Bell Laboratories, and was released in 1977 in the Version 7 Unix release
..... Click the link for more information.
..... Click the link for more information.
born again or regenerated is synonymous with spiritual rebirth — salvation. The term is most frequently used by the Evangelical, Fundamentalist, Pentecostal, and some Mainline branches of Protestant Christianity.
..... Click the link for more information.
..... Click the link for more information.
Steve Bourne is a computer scientist, most famous as the author of the Bourne shell (
Bourne has a Bachelor's degree in mathematics from King's College London.
..... Click the link for more information.
sh), which is the foundation for the standard command line interfaces to Unix.Bourne has a Bachelor's degree in mathematics from King's College London.
..... Click the link for more information.
Unices by Bell
Research Unix
V6 (1975)
V7 (1979)
V8 (1985)
V9 (1986)
V10 (1989)
CB Unix
PWB/UNIX Seventh Edition Unix, also called Version 7 Unix, Version 7 or just V7
..... Click the link for more information.
Research Unix
V6 (1975)
V7 (1979)
V8 (1985)
V9 (1986)
V10 (1989)
CB Unix
PWB/UNIX Seventh Edition Unix, also called Version 7 Unix, Version 7 or just V7
..... Click the link for more information.
..... Click the link for more information.
Chet Ramey is the current maintainer of the GNU Bourne Again Shell. He is a longtime employee of Case Western Reserve University, from which he also received his B.S. in Computer Engineering and Master's degree in Computer Science.
..... Click the link for more information.
..... Click the link for more information.
Linux (pronunciation: IPA: /ˈlɪnʊks/, lin-uks) is a Unix-like computer operating system. Linux is one of the most prominent examples of free software and open source development; its underlying source code can be
..... Click the link for more information.
..... Click the link for more information.
Mac OS X (IPA: /mæk.oʊ.ɛs.tɛn/) is a line of graphical operating systems developed, marketed, and sold by Apple Inc., the latest of which is pre-loaded on all currently shipping Macintosh computers.
..... Click the link for more information.
..... Click the link for more information.
Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification.
..... Click the link for more information.
..... Click the link for more information.
Microsoft Windows
Screenshot of Windows Vista Ultimate, the latest version of Microsoft Windows.
Company/developer: Microsoft Corporation
OS family: MS-DOS/9x-based, Windows CE, Windows NT
Source model: Closed source
..... Click the link for more information.
Screenshot of Windows Vista Ultimate, the latest version of Microsoft Windows.
Company/developer: Microsoft Corporation
OS family: MS-DOS/9x-based, Windows CE, Windows NT
Source model: Closed source
..... Click the link for more information.
This article is copied from an article on Wikipedia.org - the free encyclopedia created and edited by online user community. The text was not checked or edited by anyone on our staff. Although the vast majority of the wikipedia encyclopedia articles provide accurate and timely information please do not assume the accuracy of any particular article. This article is distributed under the terms of GNU Free Documentation License.
Herod_Archelaus