Lab 4

Before you begin:

Part I

  1. Make a directory called ~/lab4
  2. Locate assign4.txt on Scratch.
  3. Copy assign4.txt to your ~/lab4 directory.
  4. Using assign4.txt do the following:
    • Replace all occurrences of “ip” with “>>”
    • Save file as no_ip.txt.
    • Close the no_ip.txt file and reopen the original assign4.txt.
  5. Using assign4.txt do the following:
    • Delete what is currently on line 3 and replace the contents with Happy trails to you.
    • Be sure there is a single blank line after Happy trails to you.
    • Note: You should have a total of 9 lines.
    • Save file as trails.txt.
    • Close the trails.txt file and reopen the original assign4.txt.
  6. Using assign4.txt do the following:
    • Count how many times it is in the document. There are no spaces on either side of it so it can be part of a word.
    • Put that number on line 2
    • Save file as it_num.txt
    • Close the it_num.txt file and reopen the original assign4.txt.
  7. Using assign4.txt do the following:
    • Remove line 3 and put it in the buffer.
    • Make sure there is only one blank line between the paragraphs.
    • Place line 3 at the end of the document 5 times. No blank lines will separate line 7 and the pasted lines 8 through 12. You should have a total of 12 lines when done.
    • Save file as no3.txt.

To pass off

This assignment uses an auto-grader. Make sure that you have the correct files on scratch and run grade_lab4.

Take a screenshot of successful completion of the autograder and submit this in canvas. Include the shell prompt and command on your screenshot.

Last Updated 06/29/2020