----------------------- Exercise #1 for DAT2330 due January 23 ----------------------- -Ian! D. Allen - idallen@idallen.ca Remember - knowing how to find out an answer is more important than memorizing the answer. Learn to fish! RTFM! (Read The Fine Manual) Global weight: 1% of your total mark this term Due date: 14h30 (2:30pm) Friday January 23, 2004. The deliverables for this exercise are to be submitted online on the Course Linux Server using the "datsubmit" method described in the exercise description, below. No paper; no email; no FTP. Late-submission date: I will accept without penalty exercises that are submitted late but before 12h00 (noon) on Monday, January 26. After that late-submission date, the exercise is worth zero marks; but, it must still be completed and submitted successfully to earn credit in the course. Exercises submitted by the *due date* will be marked online and your marks will be sent to you by email after the late-submission date. A sample answer will be posted online after the late-submission date. This exercise is due on or before 14h30 Friday January 23, 2004. Exercise Synopsis: You are starting to learn the "vim" text editor. You will use "vim" to create a text file with answers to questions from the Readings and submit the file for marking before the due date and time. The "vim" editor is an enhanced version of the "vi" text editor that appears in all versions of Unix back to about 1980. Typing "vim" at a command prompt will start the editor. Often the command name "vi" is linked to "vim"; but, this is not always true (e.g. on ACADUNIX "vi" and "vim" are different versions!). Note: I will usually refer to "vi" or VI as the name of the editor. You should interpret this to mean "vim", not the old "vi" editor. Where to work: Do your Unix command line work on the Course Linux Server. The files you work on will remain there even after you log off. Do not erase your files after submission; always keep a spare copy of your exercises. WARNING: Do not attempt this exercise on a Windows machine - the text file format is different. You must connect to and work on Unix/Linux. Note that you may connect to the Course Linux Server *from* a Windows machine (using PuTTY); however, you may not use the Windows machine itself to do your work. Use the vim editor on the Course Linux Server. Location of the course notes on the Course Linux Server: You can find a copy of all the course Notes files on the Linux Server under directory: ~idallen/public_html/teaching/dat2330/04w/notes/ You can copy files from this directory to your own account for modification or study, if you like. (To avoid plagiarism charges, you must credit any material that you copy and submit unchanged.) Exercise Preparation: A. Do your Week 02 Readings (see week02notes.txt for details). Finish the VI tutorial before you attempt this exercise! B. Know how to connect to the Course Linux Server computer and log in. Reference: course_linux_server.txt (under the Notes button) C. Know where to find an online copy of all the course Notes on the Course Linux Sever. (See above and in course_linux_server.txt) Exercise Details (on the Course Linux Server): 0. Have you done all the preparation steps? If not, go back and do them. 1. Using VI/VIM, edit a new file named exercise01answers.txt on the Course Linux Server. The spelling of the file name must be exact, othewise it won't be marked. The spelling must be exact. Exact! At the top of the file, create an Exterior Assignment Submission label following the example you will find under the "Assignment Standards" button on my teaching home page (teaching.idallen.com). For full marks, follow the directions for the label exactly. The label has exactly 7 lines, plus an optional Comments line. The spelling of the label fields on the seven lines must be exactly as shown. The spelling must be exact. Exact! Answer the following questions in your exercise01answers.txt file on the Course Linux Server, underneath your Exterior Assignment Submission label: 2. The College Directive dealing with Academic Discipline (including plagiarism) is in your InstaGuide under Directive Number: E______ ? 3. Bring up the manual page for the "ls" command and scroll forward to find the paragraph that describes the "-i" option. (You can use the forward-search features of "less" to do this quickly.) This option has a short form ("-i") and a long form. a) What is the long form of the "-i" option? b) What does the -i option do to the output of "ls"? 4. What option to "ls" causes hidden pathnames to be shown? 5. What option to "ls" causes the modify time of pathnames to be shown? 6. On what page in "Learning Unix" are the above two options described? 7. What special Unix pathname stands for "the parent directory"? 8. From the file opt_why_shell.txt in the Notes directory extract just the first paragraph (starting with "The designer") to include in your exercise submission file. (Hints: you could read the entire opt_why_shell.txt file into your exercise file and edit away the unnecessary lines, or, you could copy the opt_why_shell.txt file to a temporary file and edit away the unnecessary lines, then read the edited version into your exercise file; or, you could use "head" and "tail" and pipes and redirection to extract the lines into a temporary file and read the temporary file into your exercise file.) Note the start and end line numbers of this single paragraph and use a single vim command to change all "the" to "XXX" in this paragraph only. (Hint: VIM tutorial Lesson 4.4.) 9. Copy these 22 Unix commands into your exercise file and, beside each command, write one line of description (to the right of the command name, on the same line) describing what the command does: a) bash - b) cal - c) cd - d) cp - e) date - f) du - g) echo - h) exit - i) file - j) grep - k) head - l) less - m) ls - n) man - o) more - p) pwd - q) stty - r) tail - s) touch - t) vi, vim - u) wc - v) who - 10. Submission. Submit the finished 9-item exercise01answers.txt file for marking as Exercise 01 on the Course Linux Server, using the following command line: $ datsubmit 01 exercise01answers.txt This "datsubmit" program will copy the selected file to my Exercise 01 directory for marking. Do not delete your copy; keep it. Verify that you submitted the file, using this command line: $ datsubmit 01 -list Note that some of the above characters are the digit 1 and some are the letter "l" (lower-case "L"). Do not confuse the two. You may redo this exercise and re-submit your results as many times as you like. I will mark only the most recent submission that is submitted before the final hand-in cutoff date. For Exercise 01, always use "01" as the first argument to "datsubmit".