Test #1 Shell Programming Part II Shell Programming - Points: 27 (5 of 15%) Write code for an executable shell script that will do the following actions, in the exact order given below. Only Step Comments are Required: Put only a one-line comment containing the step number in front of the executable code for steps 2 and greater. No other comments are needed. ________________________________________ 1. [Points: 2] Start your script with the comment line that tells the kernel to execute this script using the standard Bourne shell. Include the standard shell option that checks for undefined variables. 2. [Points: 1] Display the current host name of this computer. (Remember to number all your steps!) 3. [Points: 1] Change directories to your home directory. 4. [Points: 2] Delete recursively any directory named test1. (BONUS mark: Include an option to suppress error messages if the directory does not exist.) 5. [Points: 1] Create a new directory named test1 in the current directory. 6. [Points: 2] Create a new directory named test2 in the test1 directory. 7. [Points: 2] Make subdirectory test2 the current directory. 8. [Points: 1] Display on the screen the name of the current directory. (The display will show that you are in the test2 subdirectory of the test1 directory.) 9. [Points: 1] Put the current date into a file named date.txt in the current directory. 10. [Points: 1] Copy the date.txt file to a file named copy.txt in the parent directory. 11. [Points: 1] Rename the date.txt file to have the name old.txt. 12. [Points: 1] Change directories to the parent directory. (The current directory is now the test1 directory.) 13. [Points: 3] Create a file in the current directory named mypasswd.txt that contains the first eight and last three lines of the Unix password file. (Hint: Use two simple commands to create this file.) 14. [Points: 3] Look for lines containing the string root in the mypasswd.txt file, and save the lines into the file rooters.txt in the test2 subdirectory. 15. [Points: 3] Count the number of lines (only lines) in all the non-hidden files in the test2 subdirectory. 16. [Points: 2] Display the exact message: It's "finished" now. (Make sure all the punctuation appears in the output.) Did you read the whole test? For full marks, remember to use comments to number your steps! - FIN -