CS 497C - Homework 6 - Name:_________________ DUE: Monday, November 26 (in class) Please show all work on a separate sheet attached to this sheet. (50 points - 5 points for each problem) + (10 bonus points) 1. How do you find out the PID of your login shell? Which is the process that listens on every terminal for a login request? What is the role of th swap area in the control of processes? 2. First create a directory foo and then fill up a shell script with three commands shown below. What happens when you execute this script and why? mkdir foo; cd foo; pwd 3. If this pipeline is run from a shell script, who will be the parent and grandparent of all these processes? nl foo | sort -nr | cut -f2- 4. What is the difference between a process run with & and one run with nohup? 5. How are the signal numbers 2 and 9 generated? What are their names and how do they differ in function? 6. Frame regular expressions to match lines containing (i) jefferies jeffery jeffeys (ii) hitchen hitchin hitching (iii) Heard herd Hird (iv) dix dicks dickson dixon (v) Mcgee mcghee magee. 7. Use command substitution with grep to list the names of the persons from emp.lst who has birthday today. 8. Find out the occurrences of three consecutive and identical word characters (like aaa or bbb) using (i) grep and (ii) sed. 9. Locate lines that are less than 100 characters in length using (i) grep and (ii) sed. 10. What is wrong with this command? How do you correct it? sed 's/compute/calculated/g s/computer/host/g' foo 11. Write a command sequence to find out the number of occurrences of the word "encryption" in a file. (Note: A word may occur more than once in a line.) 12. Invert the names in short list on Page 275 and place a comma after the last name (i.e. last name, first name). What the result should look like is as below: 2233|harris, charles |g.m. |sales |12/12/52| 90000 9876|johnson, bill |director |production|03/12/50|130000 5678|dylan, robert |d.g.m. |marketing |04/19/43| 85000 2365|woodcock, john |director |personnel |05/11/47|120000 5423|wood, barry |chairman |admin |08/30/56|160000 Use as few commands as possible.