You are on page 1of 2

St Mary’s University

Department of Computer Science

Unix system administration and support - INTE 440

Name______________________________________________________ Sec_______ DUE: _______________

LAB 10: Read both of your text books + lecture notes + outside materials such as the
internet about shell and answer the following questions.

1. What are environmental variables and their relation to shell?


Two separate answers required.

2. How do you list all your shell environmental variables?


Give command:

3. State the meaning of the following in one or two statements.


(a) $PATH:

(b) $HOME:

(c) $PS1:

(d) $PWD:

4. What is the difference in meaning between $PATH and PATH? Explain.

5. Give “command to selectively see” the following environmental variable’s “value”.


(a) variable: PATH
command:
value:

(b) variable: HOME


command:
value:

(c) variable: PS1


command:
value:

6. Customizing your shell

First: Understand the concepts on your textbook “Teach yourself


Linux” from pages 91-93 + Revise the concepts covered in your lecture about
“creating script files”
Second: Execute the following. Take a screenshot and attach output.
(a) create a directory named tempscripts

(b) create a shell script file called yourlastname1.sh and save it in the directory you
created above in (a). This script file should retrieve the value of PS1 and
PS2 environmental variable and output the following two statements:

PS1 environmental variable initializes the command prompt as: // code


PS2 environmental variable initializes the command prompt as: // code

NOTE: //code: here, write the code that retrieve PS1 and PS2 value.

(c) Run your script file.

(d) Observe: run command from your terminal to see the value of PATH
environmental variable. What directory line is added to this variable that allows
your script to execute?

(e) Take a screen shot and attach output for all the above steps.

*************************** GOOD LUCK******************************

You might also like