26 February 2006

Unix Shells

(This is a subheading of Unix-3)

Superscripts on Unix commands link to the online man pages.

Because of the immense power and versatility of the Unix operating system, and because of the relatively austere user interface, there is a need for shells that envelope the kernel to various depths. In this metaphor, the OS is like a stem of wheat, and the kernel is the pulpy part inside, while the shell is the hard outer husk. Unix shells are command line interfaces but nevertheless vary considerably, and it's not unusual for Unix users to use multiple shells concurrently.

All of these standard shells are available online for free, or else come standard with any installation of Unix. Since one of the purposes of a shell is to interpret system commands, shells are sometimes spoken of as if they were programming languages/compilers. Hence, multiple shells exist for about the same reason that different programming languages do.

Here's a listing of the most common shells:

Bourne Shell (sh)man: original, stripped-down shell.

C Shell (csh)man: includes a command history list and job control. Shells related to this one (e.g., tcsh) have syntax that is incompatible with the ksh family.

Korn Shell (ksh)man: builds on the Bourne shell by adding command history list, job control, and history editing. Also known as the POSIX shell because it was the basis of the POSIX standard. This partly explains why bash, tcsh, and zsh are based on ksh.

Bourne Again Shell (bash)man: updated version of ksh, with built-in help command. This is the standard Linux (where it is known as sh).

Remote Shell (rsh)man: originally peculiar to BSD Unix, it has expanded to become a family of protocols: rcpman, rexecpman, and rshdman. The remote shell was designed expressly for remote access to online systems, but possessed a tragic flaw: it does not encrypt data.

Secure Shell (ssh)man: developed in 1995; protocol and set of standards to facilitate private, secure communications between 2 computers over an IP network. Usually used as an alternative to Telnet. The secure shell can be used to secure not only interactive access but also provides file transfer and virtual private networks (VPN's). (Main article)

TENEX C Shell (tcsh)man: a version of csh, with built-in help, created for the TENEX operating system. Because it is entirely compatible with csh, it could be ported to other Unix variants. It includes spelling correction, programmable word completion, and of course all the features of csh. However, it has been almost entirely replaced by bash.

Z Shell (zsh)man: another updated version of ksh. Of all the common Unix shells, quite possibly the most powerful. It is also one of the more recent, having been created in 1990.
Here are a few common features of Unix shells (now standard across OS's):

command history list: a listing of all commands the user enters during a session. One merely enters the history command, history.* By default, history only displays the previous command, but one can alter that with the command set history = 8 (or whatever number one likes). Depending on the shell, there are many additional commands. (Many of these will be familiar to DOS users).

history editing: useful for correcting errors. It allows one to edit command lines using the vi script editor.

job control: often Unix will be running commands in the background, so that one may well have one or two commands running in the background. Job control commands allow one to terminate (i.e., to kill) a command that is running; to suspend (i.e., to stop)
ADDITIONAL READING & SOURCES: The superscript man links to the man pages for that item. Korn Shell (page by developer David Korn); "Bourne Shell Overview," from old university course material (please note that sh is quite old and has not changed significantly from 1991); "Introduction to the C Shell," Bill Joy (revised for BSD 4.3); Kimmo Suominen, "Getting Started with SSH"; the Zsh Wiki; the TSCH Wiki; Wikipedia, Bourne Shell, C Shell, Korn Shell, bash, tcsh, zsh, Comparison of computer shells;

ONLINE TUTORIALS: Unix tutorial, Stanford University School of Earth Sciences, USA; "Unix for Web developers," eXtropia tutorials; "UNIX Tutorial for Beginners," University of Surrey, Guildford, UK; "Unix System Administration Independent Learning," esp. "Description of different kinds of shells"—USAIL; "A User's Guide to the Z-Shell," Peter Stephenson (2003)

BOOKS: UNIX: the Complete Reference, by Kenneth Rosen, Douglas Host, James Farber, & Richard Rosinski—Tata McGraw-Hill edition 2002

Labels: , , , ,


Post a Comment

<< Home