====================================== DAT2330 Test Four B - Unix - Questions ====================================== -IAN! idallen@ncf.ca You will need to be running Floppix with networking to do this test. You must have network access to use telnet and ftp to reach the machines mentioned in this test. Your directory test_four is where you must put your scripts and your script output if you want the instructor to mark them. This directory will be created by your instructor before you start your test. Your scripts do not have to create this directory; you may assume it exists any time a script specification requires you to use it. Only scripts and output found under directory test_four on the Test Machine will be marked. Only correctly-spelled script and file names will be marked. Your scripts must start with a valid Script Header, as given in class and in the Week 7 notes. Scripts without a valid header will be penalized. Scripts containing useful comments will earn bonus marks, to a maximum of five marks per script. Problem A - Marks: 50 On the Test Machine: Write an executable shell script named compdater.sh that will do the following actions (in the order given below): 1. [Marks: 6] Verify that there is exactly one command line argument; otherwise, exit with an error message. (i.e. Exit if there is not exactly one argument.) 2. [Marks: 2] Put the first argument into a variable named cprog. 3. [Marks: 5] Verify that the path named by the cprog variable is a file; otherwise, exit with an error message. (i.e. Exit if the path is not a file.) 4. [Marks: 5] Verify that the file named by the cprog variable is readable; otherwise, exit with an error message. (i.e. Exit if the file is not readable.) 5. [Marks: 5] Verify that the file named by the cprog variable is not empty; otherwise, exit with an error message. (i.e. Exit if the file is empty.) 6. [Marks: 2] Put the current date into the file myerrs.txt in the current directory. Exit with a non-zero exit status if the command fails. 7. [Marks: 8] If the file named by the cprog variable contains the 6-character string