UNIX Time-Sharing System: The UNIX Shell

01 July 1978

New Image

The UNIX Shell By S. R. BOURNE (Manuscript received January 30, 1978) The UNIX* shell is a command programming language that provides an interface to the UNIX operating system. It contains several mechanisms found in algorithmic languages such as control-flow primitives, variables, and parameter passing. Constructs such as while, if, for, and case are available. Two-way communication is possible between the shell and commands. String-valued parameters, typically file names or flags, may be passed to a command. A return code is set by commands and may be used to determine the flow of control, and the standard output from a command may be used as input to the shell. The shell can modify the environment in which commands run. Input and output can be redirected and processes that communicate through "pipes" can be invoked. Commands are found by searching directories in the file system in a sequence that can be defined by the user. I. INTRODUCTION T h e UNIX shellf is both a p r o g r a m m i n g language a n d language. As a p r o g r a m m i n g language, it c o n t a i n s primitives and string-valued variables. As a c o m m a n d provides a user interface to the process-related facilities operating system. T h e design of the shell is based in a command control-flow language, it of t h e UNIX part on the * UNIX is a trademark of Bell Laboratories. t This term (shell) seems to have first appeared in the MULTICS system (Ref. 1). It is, however, not universal; other terms include command interpreter, command language.