Previous slide Next slide Back to the first slide View text version


Notes:

As demonstrated in the first example, fgrep(1) does exact character string matches: Notice that there were no matches since it was looking for the string “^[AEIOU]”; instead of interpreting the regular expression as being: match any line where a vowel character is the first character on the respective line. This proves the point that fgrep doesn’t support UNIX regular expressions.

In example two we get the desired results of the regular expression of matching those lines that begin with a vowel at the beginning of a line. As a result, lines 2 thru 5, lines 7, 10, 11, 12, 17, 23, 25 and 27 satisfies the match (regular expression defined) from the fortunes file from the fortunes file.

We can often get the desired results using the grep command, however, grep doesn’t support the complete extended set of UNIX expressions as shown in the example on the next page.