Guide to UNIX Using Linux Fourth Edition
Chapter 6 Solutions
Answers to the Chapter 6 Review Questions
1. Your organization routinely uses scripts, but as some employees have left, there are scripts that
contain only command lines and no one is certain of their purpose. What steps can be taken to
ensure a way for others to know the purpose of a script?
2. Which of the following shells enables the use of scripts? (Choose all that apply.)
3. You frequently use the command ls -a and want to save time by just entering l to do the same
thing. Which of the following commands enables you to set your system to view hidden files by
only entering l?
4. You have written a script, but when you run it there is an error. Which of the following commands
can you use to debug your script? (Choose all that apply.)
5. You have written a shell program that creates four temporary files. Which of the following
commands can you use to remove these files when the script has completed its work?
6. Which of the following commands works well for menus used in a script? (Choose all that apply.)
7. You are currently in the source directory, which is the new directory you have just created for
storing and running your scripts. You want to make certain that the source directory is in your
default path. Which of the following commands enables you to view the current default path
settings?
8. You have created a script for use by your entire department in a commonly accessed directory.
Only you are able to run the script, which works perfectly. Which of the following is likely to be
the problem?
9. Your current working directory contains a series of files that start with the word “account”
combined with a, b, c, d, and e, such as accounta, accountb, and so on. Which of the following
commands enables you to view the contents of all of these files? (Choose all that apply.)
10. For which of the following logic structures used within a script is fi the final line for that logic
structure? (Choose all that apply.)
11. Which of the following are examples of arithmetic or relational operators? (Choose all that apply.)