Given out Monday, October 22, 2012.
Due in ANGEL Wednesday, October 31 at 6pm via ANGEL.
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.)