Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!comp.vuw.ac.nz!am.dsir.govt.nz!dsiramd!marcamd!tcnz2!greg From: greg@tcnz2.tcnz.co.nz (Greg Calkin) Newsgroups: comp.unix.misc Subject: Re: Fgrep need not be slow (was Re: Fast file scan) Message-ID: <460@tcnz2.tcnz.co.nz> Date: 9 Oct 90 20:38:22 GMT References: <143198@sun.Eng.Sun.COM> <1990Oct2.041451.3929@blilly.UUCP> <3790@awdprime.UUCP> <2440@van-bc.wimsey.bc.ca> Reply-To: greg@tcnz.co.nz (Greg Calkin) Organization: Thomas Cook NZ Head Office, Auckland, NZ Lines: 27 In article jtc@van-bc.wimsey.bc.ca (J.T. Conklin) writes: >In article tif@doorstop.austin.ibm.com (Paul Chamberlain) writes: >>Fgrep means Fixed, egrep means Exponential (like in Exponentially faster)! >>If you care one tiny bit about the speed you'll only use fgrep when you >>have to. Now can we stop discussing the fastest way to use fgrep? >> >>This lesson is a review for those that didn't believe it the first time. > >As has been mentioned before, it depends on your implementation: not >all fgreps are slow. Quite correct - in the NCR tower documentation, you get An eqrep pattern is a full regular expression; egrep uses a fast deterministic algorithm that sometimes needs exponential space. Fgrep patterns are fixed strings; fgrep is fast and compact. My testing in the past has born this out - for simple tasks, fgrep is much quicker. So, this lesson is a review for those that believe that all Unixes are the same. RTFM and experiment. -- Greg Calkin, Systems Engineer {include "sexual_hard_sell"} (greg@tcnz.co.nz) Thomas Cook N.Z. Limited, PO Box 24, Auckland CPO, New Zealand, Ph (09)-793920 Disclaimer : Would you buy a used car from someone with these opinions ?