101 lines
5.4 KiB
HTML
101 lines
5.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
|
|
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
|
|
<HEAD>
|
|
<TITLE>3.6 Types of shells</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<meta name="description" value="3.6 Types of shells">
|
|
<meta name="keywords" value="gs">
|
|
<meta name="resource-type" value="document">
|
|
<meta name="distribution" value="global">
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html3238 HREF="node118.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3236 HREF="node93.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3230 HREF="node116.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3240 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3241 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html3239 HREF="node118.html">3.7 Wildcards</A>
|
|
<B>Up:</B> <A NAME=tex2html3237 HREF="node93.html">3 Linux Tutorial</A>
|
|
<B> Previous:</B> <A NAME=tex2html3231 HREF="node116.html">3.5 Exploring the File </A>
|
|
<BR> <HR> <P>
|
|
<H1><A NAME=SECTION00560000000000000000>3.6 Types of shells</A></H1>
|
|
<P>
|
|
<A NAME=2872> </A>
|
|
As I have mentioned too many times before, UNIX is a multitasking,
|
|
multiuser operating system. Multitasking is <em>very</em> 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.
|
|
<P>
|
|
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.
|
|
<P>
|
|
<A NAME=2874> </A>
|
|
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 <b>shell scripts</b>, 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 <A HREF="node150.html#secshellscript">3.13.1</A>
|
|
for more information.
|
|
<P>
|
|
<A NAME=2877> </A>
|
|
<A NAME=2878> </A>
|
|
<A NAME=2879> </A>
|
|
<A NAME=2900> </A>
|
|
<A NAME=2901> </A>
|
|
<A NAME=2902> </A>
|
|
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</tt> (where <tt>sh</tt> 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</tt>.
|
|
<P>
|
|
<A NAME=2886> </A>
|
|
<A NAME=2887> </A>
|
|
<A NAME=2903> </A>
|
|
<A NAME=2904> </A>
|
|
<A NAME=2890> </A>
|
|
<A NAME=2905> </A>
|
|
<A NAME=2906> </A>
|
|
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</tt>), and Tcsh (<tt>/bin/tcsh</tt>). 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.
|
|
<P>
|
|
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</tt> and <tt>ls</tt>, 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.
|
|
<P>
|
|
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</tt> and <tt>tcsh</tt>).
|
|
<P>
|
|
<A NAME=2899> </A>
|
|
<P>
|
|
<BR> <HR><A NAME=tex2html3238 HREF="node118.html"><IMG ALIGN=BOTTOM ALT="next" SRC="next_motif.gif"></A> <A NAME=tex2html3236 HREF="node93.html"><IMG ALIGN=BOTTOM ALT="up" SRC="up_motif.gif"></A> <A NAME=tex2html3230 HREF="node116.html"><IMG ALIGN=BOTTOM ALT="previous" SRC="previous_motif.gif"></A> <A NAME=tex2html3240 HREF="node1.html"><IMG ALIGN=BOTTOM ALT="contents" SRC="contents_motif.gif"></A> <A NAME=tex2html3241 HREF="node250.html"><IMG ALIGN=BOTTOM ALT="index" SRC="index_motif.gif"></A> <BR>
|
|
<B> Next:</B> <A NAME=tex2html3239 HREF="node118.html">3.7 Wildcards</A>
|
|
<B>Up:</B> <A NAME=tex2html3237 HREF="node93.html">3 Linux Tutorial</A>
|
|
<B> Previous:</B> <A NAME=tex2html3231 HREF="node116.html">3.5 Exploring the File </A>
|
|
<BR> <HR> <P>
|
|
<BR> <HR>
|
|
<P><ADDRESS>
|
|
<I>Matt Welsh <BR>
|
|
mdw@sunsite.unc.edu</I>
|
|
</ADDRESS>
|
|
</BODY>
|