Chapter 7 Review Questions UNIX/Linux

Ace your homework & exams now with Quizwiz!

2. Which of the following script statements accomplishes the same thing as the statement: while [ "$part" != "alternator" ] ; do ? (Choose all that apply.)

while test $part != "alternator" ; do

20. When you create a shell function from the command line, what character do you enter at the first > prompt just after you declare the function's name?

{

17. Each month your business manually deletes specific records for employees who have left the company. You have been asked to write a script to automate this process. Which of the following commands works well for deleting records in a file?

sed -d

7. When you enter test -d tmp ; echo $?, you see a 0 displayed on the screen. What does this mean?

The tmp directory exists.

13. You have recently met with your company's budget committee about creating a script to for producing the same budget reports at the end of each month. Because this is an important undertaking you've started by creating a flowchart. What step should you take next?

Write pseudocode before you create the actual script.

3. Your shell script, called .filetests, contains several functions used to run tests on files, such as to determine if a file is empty or has the correct permissions. Which of the following is/are true about .filetests? (Choose all that apply.)

You can load the file's functions into memory by entering . .filetests. This is a hidden file.

8. What does a down arrow represent in a flowchart?

process flow

19. Which of the following characters are placed right after a function name when you create a shell function?

( )

21. What symbol is typically used at the start and end of a flowchart?

terminator

9. Which of the following are examples of Boolean operators used with the test command? (Choose all that apply.)

-a for a logical AND -o for a logical OR

18. In which of the following files would a system administrator set the default shell used by your account?

/etc/passwd

1. You have been asked to write a script for use by the faculty at the engineering school at your college. The script you write uses the Bash shell, but some faculty members often use a different shell in their work. How can you best ensure that the Bash shell is invoked when this script is run?

Enter the line # !/ bin/bash as the first line in the script.

6. You use the same five shell functions every day and are looking for a way to ensure they are available as soon as you log into your account. What can you do?

Load them via your login script.

16. When working on the script in Question 15, which of the following should you consider?

input validation


Related study sets

Το Εσωτερικό του Υπολογιστή

View Set

forensic evidence- unit 1- book summary

View Set

Chapter 23 Respiratory Wiley plus

View Set

influences on health promotion of children

View Set

Chapter 20: MAGNETIC RESONANCE IMAGING (MRI)

View Set

Chapter 26 - Part II - Rosenberg & Sec 3

View Set