[comp.binaries.ibm.pc.d] Theme variations, GREP vs EGREP vs FGREP

NU013809@NDSUVM1.BITNET (Greg Wettstein) (11/10/90)

The recent posting of these utilities to the net has caused me to think of
a question which has nagged me as long as I have worked around UNIX(c) systems.

What are the substantiative differences between these three utilities.  The
various man pages I have read have made occassional references to the fact that
their were algorithm differences between GREP and EGREP.  Specifically the
fact that GREP uses a faster pattern matching technique which is
non-deterministic while EGREP uses a slower but deterministic algorithm.  I
have also assumed that FGREP does not offer regular expression pattern matching
but rather does simple string seaches (Boyer-Moore-Gosper based no doubt).

I have grepped probably hundreds of thousands of lines of source code but have
never felt a compelling reason to reach for egrep over grep, perhaps I have
missed string matches I don't even know about......

One of the reasons I decided to post this question is that the version of
FGREP posted to c.b.i.p. made mention that it does fancy wildcard matching.
I assumed that this was the domain of only the GREP and EGREP variants.  The
second reason I am wondering is that an older version of GNU GREP that I
brought over to MS-DOS provided an MS-DOS only switch (-E) that changed the
functionality of the program from grep to egrep.  This was particularly
attractive since the gnuish version of GREP 1.5 implements the two programs
as separate executables.  Without symbolic links ala UNIX(c) this requires
the storage of two executables rather than one.

I would be interested in whatever comments the net has.  Please use the
mail address in my sig if possible.  Mail gets to me when routed to wind.
Thanks in advance for any and all commentary.

                            As always,
                            Dr. G.W. Wettstein
                            Oncology Research Division Computing Facility
                            Fargo Clinic / MeritCare

                            UUCP: uunet!plains!wind!greg
                            INTERNET: greg%wind.uucp@plains.nodak.edu
                            Phone: 7001-234-2833

`The truest mark of a man's wisdom is his ability to listen to other
 men expound their wisdom.'