% Linux Installation and Getting Started    -*- TeX -*-
% shells.tex
% Copyright (c) 1992, 1993 by Matt Welsh, Larry Greenfield and Karl Fogel
%
% This file is freely redistributable, but you must preserve this copyright 
% notice on all copies, and it must be distributed only as part of "Linux 
% Installation and Getting Started". This file's use is covered by
% the copyright for the entire document, in the file "copyright.tex".

\section{Types of shells}
\index{shells|(}
As I have mentioned too many times before, UNIX is a multitasking,
multiuser operating system.  Multitasking is {\em very\/} useful, and once 
you get used to it, you'll use it all of the time. Before long, you'll
be able to run programs in the ``background'', switch between multiple tasks,
and ``pipeline'' programs together to achieve complicated results with
a single command.

Many of the features we'll be covering in this section are features
provided by the shell itself. Be careful not to confuse UNIX
(the actual operating system) with the shell---the shell is just an
interface to the underlying system. The shell provides a great deal
of functionality on top of UNIX itself.

\index{shell scripts!defined}
The shell is not only an interpreter for your interactive commands, which
you type at the prompt. It is also a powerful programming
language, which allows you to write {\bf shell scripts}, to ``batch''
several shell commands together in a file. MS-DOS users will recognize the 
similarity to ``batch files''. 
Use of shell scripts is a very powerful tool, which will allow you to
automate and expand your usage of UNIX. See Section~\ref{sec-shell-script}
for more information.

\index{shells!Bourne shell}
\index{shells!C shell}
\index{Bourne shell}
\index{C Shell (csh)@C Shell ({\tt csh})}
\index{/bin/sh@{\tt /bin/sh}}
\index{/bin/csh@{\tt /bin/csh}}
There are several types of shells in the UNIX world. The two major
types are the ``Bourne shell'' and the ``C shell''. The Bourne shell uses a
command syntax like the original shell on early UNIX systems, such
as System III. The name of the Bourne shell on most UNIX systems is
{\tt /bin/sh} (where {\tt sh} stands for ``shell''). The C shell (not to 
be confused with sea shell) uses a different syntax, somewhat like the 
programming language C, and on most UNIX systems is named {\tt /bin/csh}. 

\index{shells!Bourne again shell}
\index{Bourne again shell}
\index{bash@{\tt bash}}
\index{/bin/bash@{\tt /bin/bash}}
\index{Tcsh}
\index{/bin/tcsh@{\tt /bin/tcsh}}
\index{tcsh@{\tt tcsh}}
Under Linux, there are several variations of these shells available.
The two most commonly used are the Bourne Again Shell, or ``Bash''
({\tt /bin/bash}), and Tcsh ({\tt /bin/tcsh}). Bash is a form of the Bourne 
shell with many of the advanced features found in the C shell. Because
Bash supports a superset of the Bourne shell syntax, any 
shell scripts written in the standard Bourne shell should work with Bash.
For those who prefer to use the C shell syntax, Linux supports Tcsh,
which is an expanded version of the original C shell. 

The type of shell that you decide to use is mostly a religious issue.
Some folks prefer the Bourne shell syntax with the advanced features
of Bash, and some prefer the more structured C shell syntax. As far
as normal commands, such as {\tt cp} and {\tt ls}, are concerned,
the type of shell you're using doesn't matter---the syntax is the same.
Only when you start to write shell scripts or use some of the advanced
features of the shell do the differences between shell types
begin to matter. 

As we're discussing some of the features of the shell, below, we'll
note those differences between Bourne and C shells. However, for
the purposes of this manual, most of those differences are minimal.
(If you're really curious at this point, read the man pages for
{\tt bash} and {\tt tcsh}). 

\index{shells|)}
