Shells in UNIX
The command interpreter in MPE is built-in: with
UNIX it's just another program. As a consequence, UNIX has many competing
command interpreters which are collectively known as shells.
The most common three shells are
- sh, the Bourne shell, whose default prompt is $; it is the oldest,
is on every UNIX system, has no job control, is the default for root, and is used
for writing command files.
- csh, the C shell, whose default prompt is %; it is from Berkeley,
and has lots of tricky features.
- ksh, the Korn shell, which is compatible with sh but
which also has many csh features, among them command history editing.
It also offers reliability.
- bash, the bourne again shell, which
is compatible with sh but which also has many csh features,
Bash does a better job of copying the csh features to the bourne shell. Although
it is not an official SUN shell, it is loaded with a standard install, and
I highly recommend it for interactive work. It is also the default shell
for Linux systems.
Your startup shell is specified by a program name as the last field in
your /etc/passwd
entry. For example, /bin/csh
means
run csh
in the /bin
directory.
One confusing thing for new users is that some commands, such as printenv
,
are built into a specific shell, while others such as rm
and
cp
are just programs in the /bin
or /usr/bin
directories. Commands that are implemented as external programs are the same
in all shells, but require some extra system overhead to create a separate
process. Built-in
commands usually do not have their own man pages, so you
have to do man ksh
and read the description of the Korn shell.