From owner-freebsd-hackers Mon Jul 5 18:14:56 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from po4.wam.umd.edu (po4.wam.umd.edu [128.8.10.166]) by hub.freebsd.org (Postfix) with ESMTP id 097DC1538D for ; Mon, 5 Jul 1999 18:14:45 -0700 (PDT) (envelope-from howardjp@wam.umd.edu) Received: from uther.wam.umd.edu (uther.wam.umd.edu [129.2.8.189]) by po4.wam.umd.edu (8.9.3/8.9.3) with ESMTP id VAA02799; Mon, 5 Jul 1999 21:14:41 -0400 (EDT) Received: from uther.wam.umd.edu (localhost [127.0.0.1]) by uther.wam.umd.edu (8.9.3/8.9.3) with SMTP id VAA13882; Mon, 5 Jul 1999 21:14:40 -0400 (EDT) Received: from localhost by uther.wam.umd.edu (8.9.3/8.9.3) with ESMTP id VAA13878; Mon, 5 Jul 1999 21:14:38 -0400 (EDT) X-Authentication-Warning: uther.wam.umd.edu: howardjp owned process doing -bs Date: Mon, 5 Jul 1999 21:14:36 -0400 (EDT) From: Jamie Howard To: freebsd-hackers@freebsd.org, tech-userlevel@netbsd.org, tech@openbsd.org Subject: Re: Replacement for grep(1) (part 2) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Due to the number of fixes I have received over the past few days, I decided to put together a new release of grep. It was either this or watch _Titanic_ on Cinemax. I incorporated a huge patch from Dag-Erling Smorgrav which as he put it "cleaned it up to make it conform to FreeBSD's coding style standards. I also removed a bunch of unused or unnecessary variables, fixed one or two minor bugs, and made a few entirely subjective cosmetic improvements." He also modified the Makefile to generate links for fgrep and egrep as well. All things I was going to worry with when it was done. :) I added the links for zgrep. I changed the sample length in the binary checker from 64 bytes to 32 at his suggestion. This is the same as how GNU grep handles it. I changed it so that even when called as grep or with -G, it treats the pattern as an extended regular expression. GNU grep behaves the same way. Simon Burge sent code to enable -w as well as several smaller code fixes and clean ups. I changed bin_file() and seekable() to operate on a pointer to a FILE rather than on an integer file descriptor. Due to popular demand, I added support for searching gzip compressed files. GNU grep only supports searching gzip compressed files. It did not bloat my code as much as I expected; I vapor locked and forgot about libz, which did all the hard work for me. It would be trivial to add support for bzip and bzip2 files for those OSes that have libbz2. Archie Cobbs dropped the hint needed to solve the problems with -x. Right now, I wrap the pattern with "^(" and ")$". I know GNU grep does this, but is this correct? Now, as it stands, I beleive this implementation is identical to GNU grep, except for the added -o option, and the -A num, -B num, -C, and -num family of options. Despite what I said before, I will implement them. Another popular demand thing. So I will take care of that over the next few days. It would be really swank if someone were to go over what I have and make sure it is correct. I know I was blowing $ before, and I think that is correct now. Due to problems with the previous download site (it is down as I type this), I will place this file in two locations: ftp://dragon.ham.muohio.edu/pub/howardjp/grep-0.3.tar.gz ftp://ftp.wam.umd.edu/pub/howardjp/grep-0.3.tar.gz It will probably be slow to hit the second, as it may be down until tomorrow morning. Thank you everyone who helped, Jamie To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message