About the Shell


A Little Background Information...

Just what is the shell anyway? It has frequently been described as a hopelessly arcane piece of code which is too big, too slow and too old! This, in turn, has inspired new incarnations of this august body, which in their time, have also become too big, too slow and too "old." So you really can't escape this front-end to, or wrapper for, the UNIX/Linux kernel, you just have to learn to live with that "lumbering elephant" in your living room...

The shell facility is available from both the OS prompt, as a command line interpreter, and from inside a shell script. When you login, you "end up" in a shell. This is determined by what is in the passwd file; it specifies the "default" shell for any given user. When you write a script, it is customary to specify which shell your script will use, i.e., the #! /bin/bash or #! /bin/sh header at the very top of the script. Otherwise, it defaults to your login shell...

Our incarnation will be the Bourne Shell, most usually found on Linux systems, and sometimes referred to as the Bourne-Again SHell (Bash). As noted, there are many varieties from which to choose. But, no matter which one you choose, they are all officially known as command line interpreters.

On a more practical note, the mastering of the shell can be an extraordinarilly handy "tool" to have in your sysop's kit. There is almost nothing it can't do, as long as you are not in a big hurry! As well as the usual installs and config scripts, I use the shell for prototyping, developing new code quickly and determining if it has "potential." And, the shell doesn't always have to be slow. It may call C/C++ code, Perl scripts, other shell scripts, and awk or sed, which can really accelerate code execution!

Despite its slow and clumsy appearance, the shell can be persuaded to excel far beyond what it was orginally intended to do. To see what the shell can do for you, see A Shell Tutorial, Loops & Subs



(Courtesy KBNorton Computer Services)