Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-unix!ctnews!pyramid!prls!mips!dce From: dce@mips.UUCP Newsgroups: comp.unix.questions Subject: Re: egrep, fgrep, grep Message-ID: <313@quacky.UUCP> Date: Sat, 18-Apr-87 00:40:57 EST Article-I.D.: quacky.313 Posted: Sat Apr 18 00:40:57 1987 Date-Received: Sun, 19-Apr-87 01:35:50 EST References: <276@wolf.UUCP> <741@mcgill-vision.UUCP> Reply-To: dce@quacky.UUCP (David Elliott) Organization: MIPS Computer Systems, Sunnyvale, CA Lines: 28 In article <741@mcgill-vision.UUCP> mouse@mcgill-vision.UUCP (der Mouse) writes: >In fact, of the above three there is no reason to use grep, and use >fgrep only when the string is unknown (such as an argument to a shell This isn't completely true because not all options/features are universally available or consistent. The -w option of grep and the special sequences \< and \> are not available in egrep or fgrep. You could implement this in egrep, but the complexity of the resulting expression might cause egrep to be slower (I haven't checked it, but egrep does slow down when () and | are involved). Another missing option is the -i (-y to some folks), which is not in egrep. The bm command is a great idea as far as speed goes, but it is yet another new command with different arguments. Very soon, a (Boyer-Moore + other improved algorithms) version of grep/egrep/fgrep will be publicly available in mod.sources (or whatever it will be called at that time). It isn't a complete replacement, as you will see, but it is compatible, so you won't have people writing shell scripts that require a non-standard command. We have been using this at Mips for a couple of months in place of the standard 4.3 versions, and are offering it with our next UMIPS-BSD release. -- David Elliott {decvax,ucbvax,ihnp4}!decwrl!mips!dce