Learn something new every day
More Info... by email
The Bourne shell is a small program that runs on Unix® and LINUX® operating systems and provides an interface to execute programs on the system. It is often referred to as a command line interface, or command interpreter, as it provides no graphical user interface (GUI) to the user. Commands, and any necessary parameters, to be executed are typed into the shell. The Bourne shell is also a scripting language, allowing users to create and execute script files that can process data through multiple programs by way of a single command. On Unix®-like systems, the program is simply known as "sh."
The first such shells for Unix® systems were known as the Thompson shell, created by Ken Thompson, one of the original creators of the Unix® operating system. The Thompson shell was limited to command interpretation, and a number of additional functions had to be executed as external operations. Later, Stephen Bourne created the Bourne shell to replace the Thompson shell, adding a number of new features into the shell itself, as well as the shell's scripting language.
In reality, the Bourne shell was planned as a scripting language from the get-go. While it was still the command line interface for Unix® version seven, it also opened up the possibility for users to develop shell scripts that would link commands together in order to process data. Through the use of this programming, the user could establish variables for capturing known or unknown data from input or output and manipulate the processing of that data through the use of conditional statements in the script via a technique referred to as control flow.
This was also the first shell to implement a feature known as signal handling. Through the Bourne shell, a user can send a specific type of signal to a process already running on the computer, instructing that process to do something else. Many of these are ways to stop a process that is executing and produce some sort of output that can be used for debugging, though others exist to temporarily halt a process, resume, and so forth.
The ability to directly control file descriptors was another first for the Bourne shell. On a Unix®-like system, every running program has a table that lists the file descriptors for any open files. This can include anything from a simple text file to a directory or even the communication sockets that processes use to share data with each other. For a user to have control over the file descriptors on a system allowed for unprecedented control over input and output for virtually everything on the computer.
Of course, even though the Bourne shell offered such additional functionality to users, it was lacking in features such as the ability to control processes interactively, establish command aliases, and retain a history. Later, however, a number of descendants began to emerge that took the most useful shell features that had been devised over the years and rolled them up into new shells. One common example is the Bourne-again shell, or Bash, which is common on many LINUX® systems. As a result, many of these descendants are fully capable of executing regular Bourne shell scripts, giving every Unix®-like system some implementation of the original Bourne shell in one way or another. On many LINUX® systems, this is simply a link from "sh" to "bash" or some other capable descendant.