CS/CE 218 Lab 4 19 September 1991 PUT YOUR NAME HERE TA: PUT YOUR TA's NAME HERE The report for this lab is due 23 September 1991 (Monday). Your report should be produced by editing this file, filling in answers to the questions below each question. When you are done, make a *printout* of your report. This lab is about the "ps" command and shell scripts. (See chapter 4 in Introducing Unix System V for ``ps'', and pages 454-457 for running shell scripts.) 0. Make a copy of /home/cs218/public/homework/lab4.txt in your (home) directory. Read the file lab4.txt. Fill in your name and your TA above. 1. Copy the file /home/cs218/public/lab-data/lab4/myps to your home directory. Then in the shell execute the command chmod +x myps a. Invoke myps with the command myps This causes the shell to run a ``ps -l'' command that is in ``myps''. (Look at the file to see the details). Using the output generated by myps, what processes are created to run myps? b. When myps is run in part a, which processes are children of what others? (Please, don't describe processes by their process ids.) c. What can you tell about how the shell executes a shell script invoked as a command? d. Execute the command . myps (Note the dot at the beginning of the line.) Using the output generated by myps, what processes are created to run myps when it is ``sourced'' by running it in this way? 2. Copy the file /home/cs218/public/lab-data/lab4/cd-print to your directory. Make cd-print executable as in problem 2. The command cd-print executes the command ``cd'' and then ``pwd''. a. Execute the command cd-print /home Then execute the command pwd What is the full path name of your current working directory? (Is that what you expected?) b. Execute the command . cd-print /home Then execute the command pwd What is the full path name of your current working directory? c. Explain what you observed in parts (a) and (b) using what you learned in problem 1. That's it, you're all done. But if you want to experiment more, you can try some or all of the problems in /home/cs218/public/homework/lab4-extra-credit.txt