delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/15/19:44:17

From: kagel AT quasar DOT bloomberg DOT com
Date: Tue, 15 Oct 1996 19:24:37 -0400
Message-Id: <9610152324.AA03279@quasar.bloomberg.com >
To: dj AT delorie DOT com
Cc: djgpp AT delorie DOT com
In-Reply-To: <199610152304.TAA14292@delorie.com> (message from DJ Delorie on Tue, 15 Oct 1996 19:04:02 -0400)
Subject: Re: GREP
Reply-To: kagel AT dg1 DOT bloomberg DOT com

   Errors-To: postmaster AT bloomberg DOT com
   Date: Tue, 15 Oct 1996 19:04:02 -0400
   From: DJ Delorie <dj AT delorie DOT com>
   Cc: djgpp AT delorie DOT com
   Content-Type: text
   Content-Length: 373


   > I won't repeat the descriptions but GREP stands for:
   > 	"Global Regular Expression Print"
   > EGREP:  Extended Global Regular Expression Print
   > FGREP:  Fast Global Regular Expression Print

   Sorry, *File* Global Regular Expression Print.  fgrep accepts a file
   of expressions to search for.  egrep is, traditionally, the fastest of
   the three, with fgrep being the slowest.

From the System V.4 man page:



NAME
       fgrep - search a file for a character string

SYNOPSIS
       fgrep [options] string [file ...]

DESCRIPTION
       fgrep (fast grep) searches files for a character string and prints
              ^^^^^^^^^
[SNIP]

Fgrep is Fast GREP because it does not accept regular expressions only strings,
and because it precompiles the list of strings into a data structure which
permits its search time to be independent of the length of the search list and
so is far faster.  While egrep and some modern grep implementations perform
similar optimizations the original grep did not, hence fgrep.  So, actually, in
my haste to reply I was wrong but you are not correct.  

By the way some sources, including the System V.4 man pages, also call EGREP
Expression GREP.  In a sense either Extended GREP or Expression GREP is at
least descriptive as the difference between grep and egrep is that grep accepts
"Limited Regular Expressions" while egrep accepts "Extended Regular
Expressions".  Taking a file of expressions to match is also an egrep feature,
BTW.

Not to have the last word but this is wnough off topic stuff for the
list/group.  Anyone interested in continuing the discussion can email directly
and I will try to CC: all interested parties.

-- 
Art S. Kagel, kagel AT dg1 DOT bloomberg DOT com

A proverb is no proverb to you 'till life has illustrated it.  -- John Keats

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019