Chapters 10&12 ExercisesRead Chapters 10 and 12 of the Unix text and work on the Unix system. Make sure you can answer the following questions:
Chapter 10 - Shell Job Control
10-1 Explain the difference between a shell job and a process.
10-2 (a) What is the Unix name of the signal you send to a process or job when you press CTRL-C? (b) Are all processes and jobs killable by the CTRL-C signal? (c) Is the vi text editor killable by typing CTRL-C?
10-3 What command do you issue to the Korn shell to receive immediate notification when a background job finishes? (Be sure to read the Textbook Errata page for Chapter 10 before you answer this.) You might want to put this useful command in your shell start-up .profile file.
10-4 What is the difference in effect between the signals CTRL-C and CTRL-Z when received by a job or process?
10-5 Is a job suspended with CTRL-Z still running? (Is it executing and using computer time?)
10-6 When a job listing shows a job is stopped because it needs (tty input) (which is displayed as (SIGTTIN) in the Korn shell), what does that mean?
10-7 If you have typed in a shell command and are waiting for it to finish (the job is in the foreground) but change your mind about waiting, what two things do you type to suspend the job and then put the job into the background so that you can do other things while it finishes?
10-8 Why is it not a good idea to use the kill command on interactive programs such as text editors or mail clients?
10-9 If I put a sleep command in the background using "sleep 999 &" and then type jobs, I will see the job executing in the background. If I then type "ksh" (start a new copy of the Korn shell) and then type jobs in that new shell, why don't I see the sleep job? [p.518]
10-10 Do the review exercises on page 519.
Chapter 12 - Shell Aliases
(Skip the C Shell Only parts of the text on pages 583-586)
12-1. If you define an alias, dir='ls -l' and then log off, will this alias remain in effect when you log on again?
12-2. What shell command lists all available aliases in your current shell?
12-3. What shell command gives the definition of one particular alias without listing all aliases?
12-4. What shell command removes an alias?
12-5. If ls is defined as an alias to ‘ls -ail', give two ways that you can call up the real ls command and not the alias, without removing the alias. [p.575]
12-6. Why does logging out cause temporary aliases to disappear? [Page 577].
12-7. Explain the steps you might use to make the shell recognize the aliases defined in the .aliases file.
12-8. Name three disadvantages of using shell aliases. [p.588]
12-9 If I define an alias for the sleep command using "alias sl=sleep" and then type alias, I will see the sl alias in the list of shell aliases. If I then type "ksh" (start a new copy of the Korn shell) and then type alias in that new shell, why don't I see the sl alias?
These exercises created originally by Maitang Mark
Web Author: Ian! D. Allen firstname.lastname@example.org