HOME

TheInfoList



OR:

The Thompson shell was the first
Unix shell A Unix shell is a command-line interpreter or shell that provides a command line user interface for Unix-like operating systems. The shell is both an interactive command language and a scripting language, and is used by the operating system t ...
, introduced in the first version of
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
in 1971, and was written by
Ken Thompson Kenneth Lane Thompson (born February 4, 1943) is an American pioneer of computer science. Thompson worked at Bell Labs for most of his career where he designed and implemented the original Unix operating system. He also invented the B programmi ...
. It was a simple command interpreter, not designed for scripting, but nonetheless introduced several innovative features to the command-line interface and led to the development of the later Unix shells.


History

The name "shell" for a
command-line interpreter A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive command (computing), commands from a user in the form of lines of text. This provides a means of setting parameters for the environment, invokin ...
and the concept of making the shell a user program outside of the operating system
kernel Kernel may refer to: Computing * Kernel (operating system), the central component of most operating systems * Kernel (image processing), a matrix used for image convolution * Compute kernel, in GPGPU programming * Kernel method, in machine lea ...
were introduced in Unix's precursor
Multics Multics ("Multiplexed Information and Computing Service") is an influential early time-sharing operating system based on the concept of a single-level memory.Dennis M. Ritchie, "The Evolution of the Unix Time-sharing System", Communications of ...
. An early feature of the Thompson shell was a compact syntax for input/output redirection. In Multics, redirecting the input or output of a command required separate commands to start and stop redirection; in Unix, one could simply add an argument to the command line consisting of the < symbol followed by a filename for input or the > symbol for output, and the shell would redirect I/O for the duration of the command. This syntax was already present by the release of the first version of Unix in 1971. A later addition was the concept of
pipes Pipe(s), PIPE(S) or piping may refer to: Objects * Pipe (fluid conveyance), a hollow cylinder following certain dimension rules ** Piping, the use of pipes in industry * Smoking pipe ** Tobacco pipe * Half-pipe and quarter pipe, semi-circul ...
. At the suggestion of Douglas McIlroy, the redirection syntax was expanded so that the output of one command could be passed to the input of another command. The original pipe syntax, as described in the Version 3 manual, was: command1 >command2> This syntax proved too ambiguous and was easily confused with redirection to and from files—the system cannot tell if "command2" is the command "command2" or the file "command2". By Version 4, the syntax had changed to use both the , and ^ symbols to denote pipes: command1 , command2 This produces exactly the same result as: command1 ^ command2 The > symbol changed into: command1 > file1 This would put the output of command1 into file1. The Thompson shell syntax for redirection with < and >, and piping with , , has proven durable and has been adopted by most other Unix shells and command shells of several other operating systems, most notably on DOS,
OS/2 OS/2 (Operating System/2) is a series of computer operating systems, initially created by Microsoft and IBM under the leadership of IBM software designer Ed Iacobucci. As a result of a feud between the two companies over how to position OS/2 ...
and Microsoft Windows.


Decline and replacements

The shell's design was intentionally minimalistic; even the ''if'' and ''goto'' statements, essential for control of program flow, were implemented as separate commands. As a result, by the 1975 release of
Version 6 Unix Sixth Edition Unix, also called Version 6 Unix or just V6, was the first version of the Unix operating system to see wide release outside Bell Labs. It was released in May 1975 and, like its direct predecessor, targeted the DEC PDP-11 family of m ...
, it was becoming clear that the Thompson shell was inadequate for most serious programming tasks. At this time, the developers of the Programmer's Workbench UNIX distribution, most notably John Mashey, began modifying the Thompson shell to make it more suitable for programming. The result, known as the PWB shell or the Mashey shell, included more advanced flow-control mechanisms and introduced shell variables, but remained limited by the necessity to remain compatible with the Thompson shell. Finally, the Thompson shell was replaced as the main Unix shell by the
Bourne shell The Bourne shell (sh) is a shell command-line interpreter for computer operating systems. The Bourne shell was the default shell for Version 7 Unix. Unix-like systems continue to have /bin/sh—which will be the Bourne shell, or a symbolic link ...
in
Version 7 Unix Seventh Edition Unix, also called Version 7 Unix, Version 7 or just V7, was an important early release of the Unix operating system. V7, released in 1979, was the last Bell Laboratories release to see widespread distribution before the commercia ...
and the
C shell The C shell (csh or the improved version, tcsh) is a Unix shell created by Bill Joy while he was a graduate student at University of California, Berkeley in the late 1970s. It has been widely distributed, beginning with the 2BSD release of the B ...
in
2BSD The History of the Berkeley Software Distribution begins in the 1970s. 1BSD (PDP-11) The earliest distributions of Unix from Bell Labs in the 1970s included the source code to the operating system, allowing researchers at universities to modify an ...
, both released in 1979. Since virtually all modern Unix and
Unix-like A Unix-like (sometimes referred to as UN*X or *nix) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Unix-li ...
systems are descended from V7 and 2BSD, the Thompson shell is generally no longer used. It is, however, available as
open-source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
as part of several Ancient Unix source distributions, and has been ported to modern Unices as a historical exhibit.


See also

* Comparison of command shells


References


External links


Manual page for the Thompson shell in Unix 1st Edition


- describes the early development of the shell

- manual pages for the 3rd, 4th, and 6th edition Thompson shells, and other resources on the early shells
Sixth Edition Thompson Shell Port
- the Thompson shell and its associated utilities ported to modern Unix systems {{Ken Thompson navbox Unix shells