Open a second terminal window and cd to /home/mathcs/courses/cs246/discworld.
For each of the following descriptions, find a regular expression that selects files
meeting that description. Run egrep with the regular expression as follows:
cat * | sort | uniq | egrep regexp. The first part of the pipeline will produce
a list of all of the books in alphabetical order, and piping into egrep will select names
matching the regular expression. You are NOT permitted to use extra commands in the
pipeline or any options for egrep.
- Book names containing J.
- Book names containing J or W.
- Book names starting with M.
- Book names starting with B or S.
- Book names starting with A through E.
- Book names ending with t.
- Book names ending with l or t.
- Book names ending with a vowel (a, e, i, o, or u).
- Book names containing Men or Ladies.
- Book names containing st and me, in that order, but possibly with characters in between.
- Book names containing two occurrences of ee.
- Book names of length 10.
- Book names of length less than 10.
- Book names of length greater than 17.
- Book names that contain at least 3 e's.
- Book names that contain 0, 1, or 2 e's.
- Book names with a length divisible by 5.
- Book names with a space immediately before a vowel.
- Book names with no upper case vowels, M's or T's.
- Book names beginning with T whose length is even.
For each part, copy the command into the lab3.txt
file, along with the output. Label each part with the appropriate letter as in lab 2.
The file contents should look like this:
2a)
cat * | sort | uniq | egrep J
Carpe Jugulum
Jingo
Johnny and the Bomb
Johnny and the DeadPart
Put a blank line in between each part. Turn your file in with turnin.