CIT052 Index > grep Exercise 2

grep Exercise 2

Do lab 1 on page 124 of the book. You will send the instructor a plain text file that has a series of egrep commands. Use egrep, not grep! The first line in the file will be the command you use to solve question one; the second line is the command you use to solve question two, etc. Use this version of the datebook file, not the one that is on the CD.

Question 7 may not work unless you use the POSIX classes (page 103) to specify uppercase and lowercase. That’s because the default for some versions of Linux is to use Unicode, where uppercase and lowercase are “folded” together.

Your patterns should work in any generic file of this sort. They should not be dependent upon the data in this particular file; if I add more lines of the same form to the file, your patterns should still work. For example, when finding the 408 area code, don't presume that 408 occurs only in phone numbers; someone might live at 408 Washington Street in Dayhoit, Kentucky, and the area code will be 606, not 408.

Name this file in the form

and email it to me. So, for example, if your name is Joe Doakes, your file would be named

Download datebook or, from the server:

cp ~linux199/datebook ~ # copies file to your home directory