PWB shell
   HOME

TheInfoList



OR:

The PWB shell (also known as the Mashey shell) was a
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 syste ...
.


History

The PWB shell was a modified (and generally constrained to be upward-compatible) version of the
Thompson shell 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 featur ...
with additional features to increase usability for programming. It was maintained by
John Mashey John R. Mashey (born 1946) is an American computer scientist, director and entrepreneur. Career Mashey holds a Ph.D. in computer science from Pennsylvania State University, where he developed the ASSIST assembler language teaching software. He wo ...
and various others (Dick Haight, Alan Glasser).
PWB/UNIX The Programmer's Workbench (PWB/UNIX) is an early, now discontinued, version of the Unix operating system that had been created in the Bell Labs Computer Science Research Group of AT&T. Its stated goal was to provide a time-sharing working envir ...
started with
Research Unix The term "Research Unix" refers to early versions of the Unix operating system for DEC PDP-7, PDP-11, VAX and Interdata 7/32 and 8/32 computers, developed in the Bell Labs Computing Sciences Research Center (CSRC). History The term ''Resear ...
4th Edition in mid-October 1973, and was frequently updated over the next few years, as the PWB department tracked
Research Unix The term "Research Unix" refers to early versions of the Unix operating system for DEC PDP-7, PDP-11, VAX and Interdata 7/32 and 8/32 computers, developed in the Bell Labs Computing Sciences Research Center (CSRC). History The term ''Resear ...
changes and added a few features. The PWB shell was released in mid-1975 and remained available through
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 ...
-based PWB/UNIX. In Version 7 Unix (1979), the PWB shell was superseded by the Bourne shell. The PWB shell was the standard shell for
PWB/UNIX The Programmer's Workbench (PWB/UNIX) is an early, now discontinued, version of the Unix operating system that had been created in the Bell Labs Computer Science Research Group of AT&T. Its stated goal was to provide a time-sharing working envir ...
, circa 1975–78., but did not run on any edition of
Research Unix The term "Research Unix" refers to early versions of the Unix operating system for DEC PDP-7, PDP-11, VAX and Interdata 7/32 and 8/32 computers, developed in the Bell Labs Computing Sciences Research Center (CSRC). History The term ''Resear ...
, as it required a new system call ''udata(2)'' that let ''login(1)'' set login name, login directory (''$s'') and TTY (''$t'') so ''sh(1)'' to obtain them.


Notable features

Several features were introduced in the PWB shell that remain in many later shells. The ''if'' and ''goto'' commands were made internal to the shell, and extended to allow ''if''-''then''-''else''-''endif'', and ''
switch In electrical engineering, a switch is an electrical component that can disconnect or connect the conducting path in an electrical circuit, interrupting the electric current or diverting it from one conductor to another. The most common type of ...
'' and '' while'' constructs were introduced, as well as ''onintr'' to ignore interrupts or catch them to perform cleanup. Simple variables could be used, although their names were limited to one letter and some letters were reserved for special purposes, of which some are the precursors of the
environment variable An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP envi ...
s found in all Unix systems from Version 7 onward. For example, The ''$s'' variable was the ancestor of ''$HOME'', used to avoid hard-coding pathnames. The ''$p'' variable was the ancestor of ''$PATH'', which let users search for commands in their own choice of directories. Unlike most of the UNIX systems of the time, the original PWB/UNIX computer center was shared by multiple programming groups who could not change the contents of /bin or /usr/bin, but wanted to create their own sets of shared commands. In addition, the shell's command-searching was enhanced to allow shell procedures to be invoked like binary commands, i.e., if the shell found a non-binary file marked executable, it would fork another shell instance to read that file as a shell script. Thus people could type ''command arguments'' rather than ''sh pathname/command arguments''. All this behavior was packaged as the function ''pexec'', which was the ancestor of ''execvp'', to allow any program to invoke commands in the same way as the shell. The $ character, used previously for identifying arguments to a shell script, became the marker for dereferencing a variable, and could be used to insert a variable's value into a string in double quotes. (In addition to later shells, this feature would also later appear in the
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offic ...
and
PHP PHP is a general-purpose scripting language geared toward web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by The PHP Group. ...
programming languages.)


Descendants

These features could not overcome the shortcomings of the Thompson shell, and so a new shell was written from scratch by Stephen Bourne. This Bourne shell was incompatible with the Thompson and PWB shells, but included equivalents of most of the PWB shell's features, but done from scratch, rather than incrementally, with much discussion among the various participants. In particular,
environment variable An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP envi ...
s and related machinery were designed by Stephen Bourne,
John Mashey John R. Mashey (born 1946) is an American computer scientist, director and entrepreneur. Career Mashey holds a Ph.D. in computer science from Pennsylvania State University, where he developed the ASSIST assembler language teaching software. He wo ...
, and Dennis Ritchie as a general mechanism to replace the earlier, more limited features. After the adoption of the Bourne shell as the standard shell 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 commercial ...
, use of the PWB shell was phased out, although for a while, there was an internal Bell Labs course called ''Bourne Shell Programming for Mashey Shell Programmers''. (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 th ...
, developed before the public release of the Bourne shell, also inherited some of the features of the PWB shell.)


See also

*
Comparison of command shells A command shell is a command-line interface to interact with and manipulate a computer's operating system. General characteristics Interactive features Background execution Background execution allows a shell to run a command without us ...


References


External links


The Traditional Bourne Shell Family: History and Development
(Sven Mascheck)
Manual page for the PWB shell
31 May 1977
Article by Mashey on the PWB shell's development and influenceUsing a Command Language as a High-Level Programming Language
{{Unix Shells Unix shells Text-oriented programming languages Scripting languages