----------------------- Exercise #01 for DAT2330 due January 3, 2005 ----------------------- -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: 0% of your total mark this term (practice lab only) Due date: Before the end of your Lab period. The deliverables for this exercise are to be submitted online on ACADUNIX using the submit 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 08h00 (8am) on Monday, January 9. After that late-submission date, the exercise is worth zero marks. 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. This exercise is due before the end of your Lab period. Exercise Synopsis: You will use "vim" to create a text file, read in another file, perform some simple edits, and save the result. Where to work: Do your Unix command line work on ACADUNIX via remote login: ssh abcd0001@acadunix.algonquincollege.com Use your own userid, not "abcd0001". See ITS for password problems. The files you work on will remain in your account after you log off. Do not erase your files after submission; always keep a spare copy of your exercises. WARNING: Nothing is saved under Knoppix. Don't save files there. 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 ACADUNIX *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 Unix machine. Location of the course notes: You can find a copy of all the course Notes files under directory (note the leading tilde character): ACADUNIX: ~alleni/public_html/teaching/dat2330/06w/notes/ Linux Server: ~idallen/public_html/teaching/dat2330/06w/notes/ You can copy files from this directory to your own account for modification or study (pick the correct line for the correct server): cp ~alleni/public_html/teaching/dat2330/06w/notes/README.txt . -OR- cp ~idallen/public_html/teaching/dat2330/06w/notes/README.txt . (Note the trailing dot on each line! To avoid plagiarism charges, you must credit any material that you copy and submit unchanged.) Exercise Preparation: A. Know where to find an online copy of all the course Notes. (See above.) B. Complete the VIM tutorial on Knoppix and/or ACADUNIX: On Knoppix type: vimtutor On ACADUNIX type: ~alleni/bin/vimtutor Any questions? See me in a lab or post questions to the Discussion news group (on the top left of the Course Home Page). ---------------- Exercise Details ---------------- 0. Have you done all the preparation steps? If not, go back and do them. 1. Using VI/VIM, edit a new file named exercise01text.txt on ACADUNIX. The spelling of the file name must be exact, othewise it won't be marked. The spelling must be exact. Exact! 2. 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! 3. Preface each of the seven lines of the label with the two characters "# " (octothorpe and one space). The lines do not have to be numbered. Leave a blank line below the label. Do the following in your exercise01text.txt file below/underneath your Exterior Assignment Submission label: 4. From the file opt_why_shell.txt in the Notes directory use VIM to extract just the one 16-line paragraph that starts with the words "Back in" and include it in the bottom of 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.) Do not change the indentation, spacing, or formatting of this 16-line paragraph. Do not use a mouse-based copy/paste. Use the VIM command that reads in a file at the current cursor position (Hint: VIM tutorial Lesson 5.4.). Make sure a blank line separates the assignment label from your paragraph in this file. 5. Note the start and end line numbers of this single paragraph and use a single VIM command to globally change *all* occurrences of the three characters "and" to "***" in this paragraph only. (Hint: VIM tutorial Lesson 4.4.) Change *all* occurrences on each line. Submission ---------- Submit the finished and labelled exercise01text.txt file for marking as using the following ACADUNIX command line: ~alleni/bin/submit 01 exercise01text.txt This program will copy the selected file to me for marking. You can copy the file more than once. Only the most recent copy will be marked. P.S. Did you spell all the label fields and file names correctly?