Datasheet

Shells
The shell is a command line interpreter that enables the user to interact with the operating system. A shell
provides the next layer of functionality for the system; it is what you use directly to administer and run
the system. The shell you use will greatly affect the way you work. The original Unix shells have been
heavily modified into many different types of shells over the years, all with some unique feature that the
creator(s) felt was lacking in other shells. There are three major shells available on most systems: the
Bourne shell (also called sh), the C shell (csh), and the Korn shell (ksh). The shell is used almost exclu-
sively via the command line, a text-based mechanism by which the user interacts with the system.
The Bourne shell (also simply called Shell) was the first shell for Unix. It is still the most widely available
shell on Unix systems, providing a language with which to script programs and basic user functionality
to call other programs. Shell is good for everyday use and is especially good for shell scripting because
its scripts are very portable (they work in other Unix versions’ Bourne shells). The only problem with the
Bourne shell is that it has fewer features for user interaction than some of the more modern shells.
The C shell is another popular shell commonly available on Unix systems. This shell, from the
University of California at Berkeley, was created to address some of the shortcomings of the Bourne
shell and to resemble the C language (which is what Unix is built on). Job control features and the capa-
bility to alias commands (discussed in Chapter 5) make this shell much easier for user interaction. The
C shell had some early quirks when dealing with scripting and is often regarded as less robust than the
Bourne shell for creating shell scripts. The quirks were eventually fixed, but the C shell still has slight
variations, resulting from different implementations based on which entity (commercial provider or
other resource) is providing the shell.
The Korn shell was created by David Korn to address the Bourne shell’s user-interaction issues and to
deal with the shortcomings of the C shell’s scripting quirks. The Korn shell adds some functionality that
neither the Bourne or C shell has while incorporating the strong points of each shell. The only drawback
to the Korn shell is that it requires a license, so its adoption is not as widespread as that of the other two.
These are by no means the only shells available. Here’s a list of some of the many shells available for the
different Unix systems:
sh (also known as the Bourne shell)[
PDKSH (Public Domain Korn shell)
bash (Bourne Again Shell a revamped version of Bourne shell)
Z shell
TCSH (TENEX C shell)
As with everything Unix, there are many different implementations, and you are free to choose the shell
that best suits your needs based on the features provided. Chapter 5 examines several shells in detail.
The Other Components
The other Unix components are the file system and the utilities. The file system enables the user to view,
organize, secure, and interact with, in a consistent manner, files and directories located on storage
devices. The file system is discussed in depth in Chapter 4.
5
Unix Fundamentals
04_579940 ch01.qxd 3/21/05 5:55 PM Page 5