6.0 Introduction to the Shell
1. The Shell is a command interpreter AND a program that runs other programs
for the user. It is the shell that provides: filename expansion (wild cards)
I/O redirection, Command Pipelines, (Sub)processes to run programs and a
full fledged programming language.
2. To start a subshell explicitly, type sh. (or ksh or bash). To start a subshell
implicitly, enclose a unix command in parentheses. e.g. (date; pwd)
To exit from a subshell, type exit or exit [n] or <Ctrl-D>
3. Input for the shell can be saved in a text file and run at any time. Such
a file is called a shell script (program). It is actually a set of
unix and shell commands batched up to run without user interaction in between.
4. Ways of running shell scripts:
(1) $ sh script parameter(s)
(2) $ chmod +x script; script parameter(s)
or ./script parameter(s)
(3) $ sh < script # no parameters to script only
Questions? Robert Katz: rkatz@ned.highline.edu
Last Update July 30, 2002