Summary

In this chapter, we examined how to create shell initialization scripts, by examining how to set environment variables and execute commonly used script commands. In addition, we reviewed some basic shell script patterns, which can be used within .profile (and other shell scripts) to perform a wide variety of repetitive actions.

Questions

1.  

What is the name of the Bourne shell initialization script?

  1. . cshrc

  2. .login

  3. .profile

  4. .init

 c. the name of the bourne shell initialization script is .profile .

2.  

What is the name of the site-wide skeleton file for the Bourne shell initialization file?

  1. /etc/skel/local.cshrc

  2. /etc/skel/local.login

  3. /etc/skel/local.profile

  4. /etc/skel/local.init

 c. the name of the site-wide skeleton file for the bourne shell initialization file is /etc/skel/local.profile .

3.  

What command would be used to set the value of the environment variable TERM to be vt220?

  1. TERM=vt220

  2. TERM= ˜vt220

  3. TERM=vt220

  4. setenv TERM= ˜vt220

 a. term=vt220 will set the environment variable for the terminal type to vt220.

4.  

What escape string is used to print an ASCII beep character in a shell prompt?

  1. \a

  2. \d

  3. \h

  4. \H

 a. the ascii beep character is \a .

5.  

What escape string is used to print a date string in a shell prompt?

  1. \a

  2. \d

  3. \h

  4. \H

 b. the date string is represented by \d .

6.  

What escape string is used to print the full hostname in a shell prompt?

  1. \a

  2. \d

  3. \h

  4. \H

 d. the shell prompt is set by \h .

7.  

What escape string is used to print a short hostname in a shell prompt?

  1. \a

  2. \d

  3. \h

  4. \H

 c. the short hostname is represented by \h .

8.  

What command is used to source another shell script while maintaining all environment settings?

  1. source

  2. sh

  3. .

  4. ./

 c. the source command is . `.

9.  

What command would be used to display the string Status OK while .profile was being executed during shell initialization?

  1. println "Status OK"

  2. printf "Status OK"

  3. echo "Status OK"

  4. cat "Status OK" >> /dev/null

 c. the command echo `status ok` will display the `status ok` string.

10.  

What parameter is used with the test command to determine whether a file is a special block file?

  1. -b

  2. -block

  3. -blockfile

  4. -bf

 a. the b option is used to test for special block files.

Answers

1.  

C. The name of the Bourne shell initialization script is .profile .

2.  

C. The name of the site-wide skeleton file for the Bourne shell initialization file is /etc/skel/local.profile .

3.  

A. TERM=vt220 will set the environment variable for the terminal type to vt220.

4.  

A. The ASCII beep character is \a .

5.  

B. The date string is represented by \d .

6.  

D. The shell prompt is set by \H .

7.  

C. The short hostname is represented by \h .

8.  

C. The source command is . ".

9.  

C. The command echo "Status OK" will display the "Status OK" string.

10.  

A. The “b option is used to test for special block files.

 
 
   


Sun Certified Solaris 9.0 System and Network Administrator
Sun Certified Solaris(tm) 9 System and Network Administrator All-in-One Exam Guide
ISBN: 0072225300
EAN: 2147483647
Year: 2003
Pages: 265
Authors: Paul Watters

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net