======================= CST8129 Lab Exercise #2 (Week 4) ======================= -IAN! idallen@ncf.ca Due: 23:00 (11pm) Friday September 20, 2002 Marks: 1% Purpose: - review some of the work done so far Hand in format: online submission only - no paper, no diskettes Part I ------ Based on notes in the "Other Useful Notes" section. Put a copy of the Assignment Submission Label into a file. Underneath the label, in the same text file, answer the following questions: I.1. True or False: the name of a file is stored in the same place as the data content of the file on disk. I.2. True or False: the name of the ROOT directory really is '/' (slash). I.3. True or False: you need write permissions on a file to be able to remove its name from a directory. I.4. True or False: you need read permissions on a directory to access the contents of a file inside that directory. I.5. What is the link count of an empty directory? I.6. What is the link count of a directory containing only 100 files? I.7. What is the link count of a directory containing only 100 subdirectories? Number your answers as shown above. Change the permissions on this answer file to "read-only" for you, "read-only" permissions for group, no permissions for other people. In the Linux lab, copy your answer file to this location: ~alleni/cst8129/02f/lab02exercise/xxxxnnnn.txt where xxxxnnnn is your Algonquin userid (e.g. abcd0001). Files with the wrong name or wrong Unix permissions will be penalized. Part II ------- Put another copy of the Assignment Submission Label into a file. Insert "#" characters in front of every line to make the lines into shell comments. In the same text file, use VI to type in script example 9.4 (p.389). Make sure the first line of the file is the line: #!/bin/bash -u (Move the line to the top of the file if necessary.) The assignment submission label will follow that first line. The rest of the script will follow the label. Test the script to make sure it works, with output similar to that indicated in the textbook. Change the permissions on this file to "read-execute-only" for you and for group, no permissions for other people. In the Linux lab, copy your answer file to this location: ~alleni/cst8129/02f/lab02exercise/xxxxnnnn.sh where xxxxnnnn is your Algonquin userid (e.g. abcd0001). (Be careful not to overwrite the xxxxnnnn.txt file from above.) Files with the wrong name or wrong Unix permissions will be penalized. Your exercise is due online before the date and time given above. Late penalty for this assignment: 33% per day