=========================== README.txt from Exercise #3 =========================== -IAN! idallen@ncf.ca This README.txt assumes you have unpacked the compressed tar archive correctly and continues where the previous instructions left off. For steps 1 through 5, see the Exercise file itself. 6) Go into the unpacked ".secret" directory (via "cd"). Now, keep going down into all the sub-directories and sub-sub-directories under .secret that you find. Hints: Some or all of the names in the directories may be hidden names; make sure you use options to view hidden names, to find hidden sub-directories. Not all the names you see are directories. You may need to fix the access permissions on the sub-directories as you descend - see Chapter 4. Descend into all the sub-directories that you find, until you can go down no longer and you find a directory containing only a few dozen files (and no more sub-directories); stop in this directory. (One of the three dozen file names in this directory is ".filea".) 7) In this last sub-directory, most of the several dozen files are decoys and do not contain useful information. Identify which file is the real compressed text file. Hint: There is a Unix command designed to test one or more files' contents and tell you what each file is - see Chapter 3. You may need to change the permission of the files to be able to let this command read and identify their contents. Use a shell GLOB (wildcard) pattern to match all the file names and pass them to the appropriate command. Let the command identify which files are data and which file is the compressed text file. 8) Rename the single file that you identified is the real compressed text file. Call the renamed file: opensource.txt.gz Do not rename any of the other dozens of decoy files. 9) Remove all the decoy files with the aid of a shell GLOB (wildcard) pattern. Only the compressed opensource.txt.gz file will remain. 10) Move the renamed opensource.txt.gz file up several levels until it is in the same directory as the README.txt file and the file1.txt file you created earlier. (See steps 1-5 in the Exercise file for how to create file1.txt.) 11) Change into the same directory that now contains opensource.txt.gz. Uncompress the compressed opensource.txt.gz file - see Chapter 3. The resulting uncompressed file should be named: opensource.txt 12) To confirm the integrity of the de-compressed text file, use the "sum" and "wc" commands. You should get the same numbers as below: $ sum opensource.txt 35008 17 opensource.txt $ wc opensource.txt 290 2474 16659 opensource.txt Do not proceed until you successfully decompress the text file and get the same numbers as above. 13) Remove the top 50 lines and bottom 50 lines from file opensource.txt and put the output into a file named "trimmed.txt". The resulting file will have these statistics: $ sum trimmed.txt 19835 11 trimmed.txt $ wc trimmed.txt 190 1560 10737 trimmed.txt The current directory should now contain four files: README.txt, file1.txt, opensource.txt, and trimmed.txt. 14) Sort the "trimmed.txt" file and also remove duplicate lines (see Chapter 3), putting the final output into a file name "sorted.txt". (There is a bug in the ACADUNIX sort command - make sure you unset the "LANG" variable before you try to sort anything. See the DAT2330 Course Announcements for details on how to do this.) The resulting output file will have these statistics: $ sum sorted.txt 12363 8 sorted.txt $ wc sorted.txt 139 1174 8032 sorted.txt The current directory should now contain five files: README.txt, file1.txt, opensource.txt, sorted.txt, and trimmed.txt. 15) Put the output of "pwd" in this directory into a file named "file2.txt". 16) Put the output of running the command "sum *" in this directory into a file named "file3.txt". 17) Put the output of running the command "wc *" in this directory into a file named "file4.txt". 18) Put the output of running the command "ls -lia" in this directory into a file named "file5.txt". 19) Submit everything in this directory for marking as Exercise 03, using the following ACADUNIX command line: $ ~alleni/bin/submit 03 * This "submit" program will copy everything in the current directory to my Exercise 03 directory for marking. (The GLOB pattern "*" matches all non-hidden files in the current directory.) 20) Verify that you submitted everything, using this command line: $ ~alleni/bin/submit 03 -l Your final submission should include these nine files: file1.txt file2.txt file3.txt file4.txt file5.txt README.txt opensource.txt trimmed.txt sorted.txt You may redo this exercise and re-submit your results as many times as you like. I will mark the most recent submission that is submitted before the final hand-in cutoff date. (Make sure you include all nine files in every submission.) For Exercise 03, always use "03" as the first argument to "submit".