grep exercise

Perform the "LAB 1: grep EXERCISE" at the end of Chapter 4 of the Quigley textbook, p. 124. It asks you to extract 10 subsets, using 10 grep commands, from the 27-line file called datebook from the book's accompanying CD. Please figure out the right grep command incantation to obtain each subset. Then, put them in order in a script file named "grep-exercise.sh" sandwiched between lines you insert that read "echo ---". Your output will appear similar to:

---
<qualifying line>
<qualifying line>
---
<qualifying line>
<qualifying line>
<qualifying line>
<qualifying line>
---
 .
 .
 .

---
<qualifying line>
<qualifying line>
<qualifying line>
---

Run the script, redirect the output to a file named "grep-exercise.txt" and put, or leave, that file in your assignments directory on the remote server.

I will grade your file by comparing it for identity with my copy of the correct result as the grading benchmark. I will do so using the diff command, naming my benchmark file and your file as arguments. I am including "echo ---" both at the top, bottom, and between each grep command of the file. Do the same in order to make sure your file comes out exactly like the benchmark file. If your file is identical you get 100%. If less than identical I will downgrade by some metric based on the amount of output produced by diff (the less output, the better). You have fully within your control the ability to get the perfect correct output. You work on each grep till it outputs the correct target lines from the datebook file, which you can predetermine by visual examination of the file. There should be no case in which a student turns in wrong output unawares. Therefore I will be expecting the full, correct file from you and be ungenerous with partial credit. Work at it till it's right; do it till it's done. Then turn it in.