27.3. What's a Shell, Anyway?
A
shell is a program that interprets your command
lines and runs other programs. Another name for the shell is
"command interpreter." This article
covers the two major Unix shell families, including discussion about
how shells run, search for programs, and read shell script files.
27.3.5. Bourne Shell Used Here
Most serious shell
programmers write their scripts for the Bourne shell or its variants,
such as bash or ksh. So do we.
Newer Bourne shells have features -- such as shell functions (Section 29.11), an unset command for
shell variables, and others -- that the earlier Version 7 Bourne
shell didn't. Most scripts in this book are written
to work on all Bourne shells -- for the sake of portability, some
scripts don't use these new features.
It's pretty rare to find such old shells around
nowadays, though, so use your own judgment. It is pretty unlikely
that if you're writing a shell script for your own
use on a new system you will ever need to back-port it to run on a V7
system.
For the rest of these introductory articles, it may be easier if you
have a terminal close by so you can try the examples. If your account
uses the Bourne shell or one of its relatives
(ksh, bash, etc.), your
prompt probably has a
dollar sign ($) in it somewhere, unless
you've modified the prompt
yourself (Section 4.1). If your account
isn't running the Bourne shell, start one by typing
sh. Your prompt should change to a dollar
sign ($). You'll be using the
Bourne shell until you type CTRL-d at the start of a line:
% sh
$
$ ...Enter commands...
$ CTRL-d
%
| | | 27.2. How the Shell Executes Other Commands | | 27.4. Command Evaluation and Accidentally Overwriting Files |
Copyright © 2003 O'Reilly & Associates. All rights reserved.
|
|