Notes and fixes for the grep assignment

Name your output files gout1, gout2, etc.

You can create a simple shell program that looks like this:

#!/bin/sh diff gout$1 /usr2/berezin/data/gout$1

Name it difit

Make it executable and you can compare the output of your answer with mine by simply running

difit 1

at the prompt in the directory where you put the output of your answer. Change the number for each problem, if difit generates output, look at the output and see if you can determine why yours is different than mine.

You must put comments in you answer file. Use # at the beginning of the line and note which question and what is supposed to do. Then give your answer on the next line. Your file should be designed so that the ta can actually run it.

Some answers may vary in order of lines, so if difit claims a difference but it looks like the same lines in different order, first check (wc) whether the character word and line counts are different for each file.

Specific problems

#14 remember a string is a sequence on non-whitespace characters. It may be delimited by whitespace on either or both ends or by the beginning and/or end of line. Check for only strings delimited with white space.

#16 spaces should read whitespace. I want a line longer than 40 character.

#17,18,19 besides comparing with my files, use cat -vet to view the contents, the options will mark the end of the line and tab characters.

#21 Ignore case. Also, The basic answer will probably only find words that are 2 characters long or longer. See if you can find a way to also catch the words a and I.

#26 Find a pair of characters repeated elsewhere on line. May be immediately after first pair.

#27 Words repeated anywhere on line, they may appear next to each other.

#31,32,33 may produce slightly different answers. It has to do with whether the specific regular expression recognizes a blank line as a line that starts with something other than #1 or not.