Lesson 2 | What shells are available? |
Objective | Identify the Various UNIX Shells |
Identify Various UNIX Shells
Because a shell is like any other UNIX program, rather than being integrated with the operating system, programmers are free to use any type of shell to meet their needs. The result is that numerous shells are used on various versions of UNIX today. All of these shells share a common ancestry and many features, but they also differ in important respects. Each of these shells can be downloaded for free.
The Bourne shell
The first UNIX shell, the Bourne shell, was developed 20 years ago at AT&T Bell Labs by Stephen R. Bourne. Because this shell is installed on virtually all UNIX systems, it is the one that this course focuses on for shell programming. Although the original Bourne shell (installed as the program /bin/sh on most systems) does not include many interactive features like a command history, shell scripts written for the Bourne shell will run on most other shells. So, if you will eventually be using another shell, or currently have another shell installed on your system, you will be able to apply the skills that you are learning in this course.
The C shell
About ten years after the Bourne shell was developed, Bill Joy at the University of California at Berkeley developed a new shell that he called the C shell. The goal of this shell was to overcome the limitations of the Bourne shell for interactive work while changing the syntax of shell programming from the style used by Bourne (based on the older
ALGOL language)
[1] to the syntax of the C programming language, hence the name. The C shell is normally installed as /bin/csh. Although it is not popular for writing shell scripts, it is widely used for interactive work at a command-line level.
The TENEX/TOPS C shell
A revision of the C shell called the TENEX/TOPS C shell includes additional interactive features. This shell, installed as /bin/tcsh, is not available on many corporate UNIX systems. You can learn where to download a copy of the tcsh program on the Resources page.
The Korn shell
For many years, the Bourne shell was preferred for shell programming, and the C shell for interactive work at the command line. David Korn of AT&T Bell Labs decided to combine the best of both in his Korn shell (installed as /bin/ksh). This shell became very popular with users for both programming and command-line work. Three versions of the Korn shell are available:
- The official Korn shell, ksh
- The public domain Korn shell, a free re-implementation named pdksh
- The Desktop Korn shell (dtksh) which is included with the CDE destkop interface on some UNIX systems
The Bourne again shell
Another revision of the Bourne shell is called the “Bourne again shell” (bash).
This version of the Bourne shell includes most of the interactive features that made the Korn shell popular. The bash shell is the default on Linux systems.
The Z shell
Another variant on these same themes is the Z shell, zsh. This shell combines the interactive features of the Korn and bash shells with the programming syntax of the C shell.
Check the following Slide Show to see the development of the family history of UNIX shells.
- Stephen Bourne develops the Bourne shell
- Bill Joy creates the C shell to add interactive features.
- David Korn adds interactive features to the Bourne shell to create the Korn shell.
- The C shell is refined in the TENEX/TOPS C shell.
- The Bourne shell is revised as the Bourne again shell.
- The Z shell and public domain Korn shells build upon their predecessors.
[1]ALGOL language: An old computer programming language (no longer used) with a syntax similar to Bourne shell programming.