Using sed - Part 1


Each team member must complete this assignment individually in his or her own it341 directory.

This project will not be done on your virtual machine.

Instead, it will be done on users.cs.umb.edu.
  1. Log in to users.cs.umb.edu
    You will need an ssh client to do this.

    Make your terminal window as wide as possible, such that it is as wide as your screen. However, you can also reduce the terminal window's height, if you like, so that you can stack it and your browser window, one on top of the other -- as in this image.
  2. Go to your it341 directory

  3. Create a directory for this project

  4. Go to your assign3 directory

  5. Here, you will be using the script utility. If you are not familiar with this utility, then please let me know.
    Start a script to save your shell interaction:

    During your script session, be careful about what you type so that you do not end up introducing various "junk characters" into your output. This includes things like backspacing, using directional arrows, and commands that seize or wipe your terminal. So, avoid commands like less, more, clear, nano, etc. If you find yourself making many mistakes, you may need to abort your script session and start over!
  6. Copy practice files to this directory

  7. Display the contents of night.txt

  8. Change the first instance of night to day

  9. Look at the contents of new_night.txt

  10. Change every instance of "night" to "day"

  11. Look at the contents of new_night.txt

  12. Change every instance of "day" to "night"

  13. Look at the contents of course_directory.txt

  14. Change "it244" to "it341"

  15. Look at the contents of new_course_directory.txt

  16. Change "f13" to "s14"

  17. Add a line of text to night.txt

  18. Look at the contents of new_night.txt

  19. Add another new line of text

  20. Look at the contents of new_night.txt

  21. Delete a line from night.txt

  22. Look at the contents of new_night.txt

  23. Delete another line from night.txt

  24. Look at the contents of new_night.txt

  25. Use a pipeline to make two changes at once
    Delete the line from night.txt with the word "nite" and add a new line to the end.

  26. Look at the contents of new_night.txt

  27. Exit from script utility. (You should then have a file in the directory called typescript)

  28. Run the less utility on your typescript file, in order to ensure that the latter is readable.

    If the output looks garbled or scrambled, or just does not look like it should based on your session, then you may have introduced some unwanted control characters that are affecting the terminal display. In this event, you will need to redo your script session in order to produce a version that I can read and check more easily.