Shell Programming  «Prev  Next»

Unix Shell - Quiz

Each question is worth one point. Select the best answer or answers for each question.
 

1. Which of the following statements describes the relationship between a shell and the operating system itself?
Please select the best answer.
  A. The shell has a unique relationship with the operating system because it controls starting other programs.
  B. The relationship between the shell and the operating system is special but not unique; the shell has certain privileges used to complete its work.
  C. The shell is like any other program run on UNIX; it has no special relationship to the operating system.
  D. The shell actually has lower privileges from the operating system than most programs, to protect the system from security hazards.

2. Which of the following shell programs is least compatible with the original Bourne shell (sh)?
Please select the best answer.
  A. csh
  B. pdksh
  C. bash
  D. ksh

3. What is the disadvantage to programming for the C shell (or its descendants)?
Please select the best answer.
  A. The author, Bill Joy, never intended it to be used for shell programming.
  B. The C language syntax of these shells is no longer in vogue.
  C. Programming for the C shell is difficult because of missing programming functionality.
  D. There is no big disadvantage; programming for the C shell is considered applicable for many circumstances.

4. The interactive features that make modern shells easier to use at the command line include
Please select all the correct answers.
  A. Filename completion to avoid typing lengthy or complex filenames
  B. Command history to avoid reentering previously used commands
  C. Multiple process management from one command-line interface
  D. Instant toggling between different command modes

5. Which of the following are key reasons to develop shell scripts for the sh shell?
Please select all the correct answers.
  A. The sh shell is available on practically all UNIX systems.
  B. The syntax of sh shell scripts is widely used outside shell scripting and therefore provides cross-over benefits.
  C. Most of the shell scripts a user will encounter are written for the sh shell.
  D. Few programming enhancements have been made in newer Bourne-compatible shells, hence older scripts remain compatible.