From: utzoo!decvax!ittvax!swatt Newsgroups: net.unix-wizards Title: Re: grep Article-I.D.: ittvax.657 Posted: Wed Mar 16 10:07:07 1983 Received: Wed Mar 23 00:26:07 1983 References: floyd.1304 Andy's performed a valuable service showing USENET readers just what a wonderful job "egrep" is. I remember being completely blown away back in 1979 when I discovered comparing the three "grep"s on multi-megabyte listing files using an 11/70, and discovered "egrep" was the fastest of the lot, even on very long expressions. It demonstrates once again the power of good algorithms. However I still use good 'ol "grep" most of the time because (1) my fingers are VERY good at typing it, and (2) it has fewer metacharacters that I have to escape if I want them literally. Also note that "egrep" takes a fair amount of time to just compile that regular expression, whereas "grep" is very fast. Take a look at /bin/calendar: it creates a file with two egrep-style regular expressions, and then "egrep"s through calendar files using that file as the set of regular expressions. The time required for egrep to actually process the input is trivial, but it can take a significant fraction of a CPU second to compile the expression. Also, "grep" has some options which "egrep" lacks, notably the "ignore case" flag. Conclusion: The grep man page authors are right -- there isn't yet one grep for all seasons. - Alan S. Watt