CSC 271-Software I : Utilities and Internals
Dr. R. M. Siegfried
Assignment #8 - Using grep
and
sed
Due Wednesday, October 11, 2017
- Use grep and wc to determine how many times Edgar Allen Poe's poem "The
Raven" contains the word "raven". You can find the poem
here.
- Use grep or egrep to pick out the lines in a text file which satisfy:
- Blank lines
- Lines with at least 3 characters
- Exactly 3 letters from abc
- Of the format non-a followed by 3 to 5 a's followed by a non-a
- Lines without the punctuation
- Lines with an upper case letter
- Lines with abc or cba or bdc
- Use sed to change a text so that every period at the end of a sentence is
changed to an exclamation point (!) and every question mark is replaced with
an ellipsis (...).
- Change every occurrence of the word forest with woods but only at the end
of a line
- Use sed to change a document so that every occurrence of a three-letter
abbreviation for a month is replaced by the appropriate number, i.e., Jan is
replace by 1, Feb by 2 etc.
[Back to the Assignment List]