Homework 5 –Filters

Given out Monday, October 14, 2019

Due in Blacbkard on Sunday, October 27, 2019 at 1159pm

You will need access to a Unix (or Unix-like) system for this assignment. There is no requirement to use a particular system, or kind of system.

You will need to submit your name, student ID, and the answers to the following questions. For this assignment, you will be doing things with the poem "Jabberwocky." Here is a text file containing "Jabberwocky". 

Each item below is worth 10 points. To get credit, show both the command you used and the output that resulted.

1.        Find a regular expression that will allow you to grep for all lines containing words that start with "H" and end with "d".

2.        Find a regular expression that will match all lines containing a capital "T", but not if capital "T" is the first character in the line.

3.        Using sed, replace "'Twas" with "It certainly was" (notice the apostrophe before the ‘T’).

4.        Using sed, replace all occurrences of "the" or "The" with "a" or "A" (preserving the capitalization of the original).

5.        Find all of the punctuation marks used in the poem, and give a count of the number of occurrences of each. (Hint: you can do something similar to the "tr + sort" word count example in the notes.)