Utah Tech Logo

IT3300

DevOps virtualization

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.

The grading script will be run as you are logged into scratch. The command you will execute will be similar for all of your assignments that have an autograder. Here is a sample of the command you will run: run_grader.py --n 2. The 2 is representative of lab2. (Lab 3 would replace the 2 with a 3). You will see some feedback. You should make sure that all your tests pass and that your score is correctly recorded. Please see your instructor for any help or questi ons on the output.