CIS 155 UNIX Operating System, Review Exercises
Chapters 9-10 Questions and Answers.
Chapter 9 Review Exercises.
1. What are the major functions of the shell?
Filename Substitution If filename substitution (also called filename generation) is
specified on the command line, the shell first performs the substitution and then executes
the program. (The filename substitution characters—metacharacters * and ?—were
discussed in Chapter 8.)
I/O Redirection The input/output redirection is handled by the shell. Again, the shell
program itself is not involved, and the redirection is set up before the command execution.
If input or output redirection is specified on the command line, the shell opens the
file and connects it to the standard input or standard output of the program respectively.
This topic was discussed in Chapter 8.
Pipes Pipes, also called pipelines, let you connect simple programs together to perform
a more complex task. The vertical line on the keyboard (|-) is the pipe operator.
Environment Control The shell lets you customize your environment to suit your needs.
By setting the appropriate variables, you may change your HOME directory, prompt sign,
or other aspects of your working environment.
Background Processing The background processing capability of the shell enables you
to run programs in the background while doing other jobs in the foreground. This is
helpful for time-consuming, noninteractive programs.
Shell Scripts Commonly used sequences of the shell commands can be stored in files
called shell scripts. The name of the file later can be used to execute the stored program,
enabling you to execute the stored commands with a single command. The shell also
includes language constructs that allow you to build shell scripts that perform more
3. What are the metacharacters? How does the shell interpret them?
metacharacters, or special characters, are interpreted and
processed in a special manner by the shell.
5. What are the shell variables?
Variables are named items you set to specific values to control or customize your environment.