From owner-freebsd-hackers Tue Jul 27 9:26:34 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from c2-10-dbn.dial-up.net (c2-10-dbn.dial-up.net [196.34.155.138]) by hub.freebsd.org (Postfix) with ESMTP id 8D02C14BEC for ; Tue, 27 Jul 1999 09:26:24 -0700 (PDT) (envelope-from rnordier@nordier.com) Received: (from rnordier@localhost) by c2-10-dbn.dial-up.net (8.8.7/8.6.12) id SAA05638; Tue, 27 Jul 1999 18:25:45 +0200 (SAST) From: Robert Nordier Message-Id: <199907271625.SAA05638@c2-10-dbn.dial-up.net> Subject: Re: replacing grep(1) In-Reply-To: from Dag-Erling Smorgrav at "Jul 27, 1999 01:37:35 pm" To: des@yes.no (Dag-Erling Smorgrav) Date: Tue, 27 Jul 1999 18:25:43 +0200 (SAST) Cc: hackers@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Jamie Howard (howardjp@wam.umd.edu), with a little help from yours > truly, has written a BSD-licensed version of grep(1) which has all the > functionality of our current (GPLed) implementation, plus a little > more, in one seventh the source code and one fourth the binary code. > I move that we replace GNU grep in our source tree with this > implementation, once it's been reviewed by all concerned parties. A couple of general problems: o Too many diagnostics have "Undefined error: 0" appended. Particularly in the case of "err(2, re_error)" in file.c, you probably want to look at using errx() instead. o Errors other than "no match" need to return a exit status of 2: some in file.c and util.c are returning 1. A more general concern is whether Henry Spencer's regex routines -- at least in our present "alpha-quality" version -- are up to supporting a grep without much further debugging. I don't recall many of the problems I found when I last looked at these, though here are two, after 5 minutes playing: echo xx | grep '\(x\{1,2\}\)\1' echo x | grep '[--x]' -- Robert Nordier To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message