Information about Bourne Shell

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 distributed to colleges and universities. It remains a popular default shell for Unix accounts. The binary program of the Bourne shell or a compatible program is located at /bin/sh on most Unix systems, and is still the default shell for the root superuser on many current Unix implementations.

Origins

The shell was designed as a replacement for the original Thompson shell.

Among the primary goals were:

Notable features

Although it is used as an interactive command interpreter, it was always intended as a scripting language. It gained popularity with the publication of The UNIX Programming Environment by Brian W. Kernighan and Rob Pike. This was the first commercially published book that presented the shell as a programming language in a tutorial form.

The Bourne shell also was the first to feature the convention of using file descriptor 2> for error messages, allowing much greater programmatic control during scripting by keeping error messages separate from data.

Other innovations in this shell included:
  • Command substitution using back quotes: `command`.
  • Here documents using << to embed a block of input text within a script.
  • "for ~ do ~ done" loops, in particular the use of $* to loop over arguments.
  • "case ~ in ~ esac" selection mechanism, primarily intended to assist argument parsing.
  • sh provided support for environment variables using keyword parameters and exportable variables.
Over the years, the Bourne shell was enhanced at AT&T. The various variants are thus called like the respective AT&T Unix version it was released with (some important variants being Version7, SystemIII, SVR2, SVR3, SVR4). As the shell was never versioned, the only way to identify it was testing its features.

Stephen Bourne carried into this shell some aspects of the ALGOL 68C compiler that he had been working on at Cambridge University. Notably he reused portions of ALGOL 68's "if ~ then ~ elif ~ else ~ fi", "case ~ in ~ out ~ esac" and "for ~ while ~ do ~ od" clauses in the common Unix Bourne shell syntax. Moreover - although the v7 shell is written in C - Bourne took advantage of some macros[1] to give the C source code an ALGOL 68 flavor. These macros co-inspired the IOCCC - International Obfuscated C Code Contest (Co-inspired with the finger command as distributed in Unix version 4.2BSD)[2].

Descendants

The C shell (csh), derived not from the Bourne shell but the Thompson shell, was distributed with 4.1BSD, and took advantage of job control features of the BSD kernel. Job control is the ability to stop a program interactively and then restart it later. It was for this reason that the C shell gained popularity as a command interpreter. The C shell used a more "C like" syntax for its programming features that was incompatible with the Bourne shell and purportedly an improvement. Job control functionality was eventually incorporated into later versions of the Bourne shell, as well as most of its descendants.

The Korn shell (ksh) written much later by David Korn, was a middle road between these two shells, with syntax chiefly drawn from the Bourne shell and job control features drawn from the C shell. The functionality of the original Korn Shell (known as ksh88 from the year of its introduction) was used as a basis for the POSIX shell standard; a newer version, ksh93, has been open source since 2000 and is used on some Linux distributions; there is also a clone of ksh88 known as pdksh.

rc was created at Bell Labs by Tom Duff as a replacement for sh for Version 10 Unix. It is the default shell for Plan 9 from Bell Labs and Inferno. It has been ported to UNIX as part of Plan 9 from User Space.

Bash, also known as the Bourne-Again shell, was later developed for the GNU project and takes features from the Bourne shell, csh and ksh.

Due to copyright issues surrounding the Bourne Shell as it was used in BSD releases, Kenneth Almquist developed a clone of the Bourne Shell, known as the Almquist Shell and available under the BSD license, which is in use today on some BSD descendants and in low-memory situations. The Almquist Shell was ported to Linux, and the port renamed the Debian Almquist shell, or dash. This shell provides much faster execution of standard sh scripts with a smaller memory footprint than its more common counterpart, bash. Unfortunately its use tends to expose bashisms - bash-centric assumptions made in scripts meant to run on sh.

Usage

The Bourne shell is now standard on all current branded Unix systems, although historically BSD based systems had many scripts written in csh. Bourne shell scripts can typically be run with bash or dash on Linux or other Unix-like systems.

After Sun released their OpenSolaris variant of the Bourne shell as Open Source, a port of this shell for free Unix flavours (geared for legacy portability and historic interest) has been made available by the Heirloom project. The Solaris/SVR4 version of the Bourne Shell does not have the same ALGOL68ized source code as the original.

See also

References

1. ^ Bourne, Steve (1979-01-12). mac.h - Macros used by Bourne to structure C like Algol68C. AT&T. Retrieved on September 9, 2006.
2. ^ Landon Curt Noll, Simon Cooper, Peter Seebach and Leonid A. Broukhis (2004). The IOCCC FAQ - Q/A: How did the IOCCC get started?. www.ioccc.org. Retrieved on September 9, 2006.

External links

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.
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.
The Thompson shell was the first Unix shell, introduced in the first version of Unix in 1971, and was written by Ken Thompson. It was a simple command interpreter, not designed for scripting, but nonetheless introduced several innovative features to the command line interface and
..... Click the link for more information.
Steve Bourne is a computer scientist, most famous as the author of the Bourne shell (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.
AT&T Inc.

Public (NYSE:  T )
Founded 1983[1]
Headquarters San Antonio, Texas, USA

Key people Randall L. Stephenson, Chairman/CEO; Richard Lindner, CFO
Industry Telecommunications
Products Wireless, Telephone, Internet, Television
..... Click the link for more information.
Bell Laboratories (also known as Bell Labs and formerly known as AT&T Bell Laboratories and Bell Telephone Laboratories) is part of the research and development organization of Alcatel-Lucent and previously the United States Bell System.
..... 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.
executable or executable file, in computer science, is a file whose contents are meant to be interpreted as a program by a computer.

While a file in source form may be executable, such a file is usually referred to as a "script.
..... Click the link for more information.
Unix (officially trademarked as UNIX®) is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs including Ken Thompson, Dennis Ritchie and Douglas McIlroy.
..... Click the link for more information.
On many computer operating systems, superuser, or root, is the term used for the special user account that is controlled by the system administrator.

Many older operating systems on computers intended for personal and home use, including MS-DOS and Windows 9x, are not
..... Click the link for more information.
The Thompson shell was the first Unix shell, introduced in the first version of Unix in 1971, and was written by Ken Thompson. It was a simple command interpreter, not designed for scripting, but nonetheless introduced several innovative features to the command line interface and
..... Click the link for more information.
A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language. Typical operations performed by shell scripts include file manipulation, program execution, and printing text.
..... Click the link for more information.
In computer science control flow (or alternatively, flow of control) refers to the order in which the individual statements, instructions or function calls of an imperative or functional program are executed or
..... Click the link for more information.
variable (IPA pronunciation: [ˈvæɹiəbl]) (sometimes called a pronumeral) is a symbolic representation denoting a quantity or expression.
..... Click the link for more information.
file descriptor is an abstract key for accessing a file. The term is generally used in POSIX operating systems. In Microsoft Windows terminology and in the context of the C standard I/O library, "file handle" is preferred, though the latter case is technically a different object
..... Click the link for more information.
signal is a limited form of inter-process communication used in Unix, Unix-like, and other POSIX-compliant operating systems. Essentially it is an asynchronous notification sent to a process in order to notify it of an event that occurred.
..... Click the link for more information.
Environment variables are a set of dynamic values that can affect the way running processes will behave on a computer.

Synopsis

In all Unix and Unix-like systems, each process has its own private set of environment variables.
..... Click the link for more information.
In computing, a process is an instance of a computer program that is being sequentially executed.[1] While a program itself is just a passive collection of instructions, a process is the actual execution of those instructions.
..... Click the link for more information.
In computer programming, a parameter is a variable which takes on the meaning of a corresponding argument passed in a call to a subroutine. In the most common case, call-by-value, a parameter acts within the subroutine as a local (isolated) copy of the argument, but in other
..... Click the link for more information.
Scripting redirects here. For other uses, see script.


Scripting languages (commonly called script languages) are computer programming languages that are typically interpreted and can be typed directly from a keyboard.
..... Click the link for more information.
The Unix Programming Environment is a textbook written by Brian W. Kernighan and Rob Pike, both of Bell Labs. It is considered an important and early book on the Unix operating system. Often considered "the Bible", it is also considered the most authoritative work on Unix.
..... Click the link for more information.
Brian Wilson Kernighan (IPA pronunciation: ['kɛrnɪˌhæn], the 'g' is silent), (born 1942 in Toronto, Ontario, Canada) is a computer scientist who worked at Bell Labs alongside Unix creators Ken Thompson and Dennis
..... Click the link for more information.
Robert C. Pike (born 1956) is a software engineer and author. He is best known for his work at Bell Labs, where he was a member of the Unix team and was involved in the creation of the Plan 9 from Bell Labs and Inferno operating systems, as well as the Limbo programming
..... Click the link for more information.
file descriptor is an abstract key for accessing a file. The term is generally used in POSIX operating systems. In Microsoft Windows terminology and in the context of the C standard I/O library, "file handle" is preferred, though the latter case is technically a different object
..... Click the link for more information.
An error message is a message displayed when an unexpected condition occurs, usually on a computer or other device. Error messages are often displayed using dialog boxes. Error messages are used when user intervention is required, indicate that a desired operation has failed, or
..... Click the link for more information.
A here document (also called a here-document or a heredoc), is a way of specifying a string literal in shells such as Bash, Windows PowerShell and the Bourne Shell, as well as programming languages such as Perl, PHP, Python and Ruby.
..... Click the link for more information.
The ALGOL68C computer programming language compiler was developed for the CHAOS OS for the CAP capability computer at Cambridge University in 1971 by Stephen Bourne and Mike Guy as a dialect of ALGOL 68. Other early contributors were Andrew D. Birrell[1] and Ian Walker.
..... Click the link for more information.
University of Cambridge (often Cambridge University), located in Cambridge, England, is the second-oldest university in the English-speaking world and has a reputation as one of the world's most prestigious universities.
..... Click the link for more information.
ALGOL 68

Paradigm: multi-paradigm: concurrent • imperative
Appeared in: 1968, last revised 1973
Designed by: A. van Wijngaarden, B.J. Mailloux, J.E.L. Peck and C.H.A. Koster, et al.
..... Click the link for more information.
Unix (officially trademarked as UNIX®) is a computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs including Ken Thompson, Dennis Ritchie and Douglas McIlroy.
..... 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


page counter