From owner-freebsd-hackers Sat Jul 3 14: 0:56 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from duh.org (www.duh.org [207.30.95.212]) by hub.freebsd.org (Postfix) with ESMTP id BD2F114CE2 for ; Sat, 3 Jul 1999 14:00:49 -0700 (PDT) (envelope-from tv@pobox.com) Received: from localhost (IDENT:tv@localhost [127.0.0.1]) by duh.org (8.9.3/8.9.3/3.1.1) with ESMTP id RAA21567Sat, 3 Jul 1999 17:00:41 -0400 (EDT) Date: Sat, 3 Jul 1999 17:00:41 -0400 (EDT) From: Todd Vierling X-Sender: tv@server.duh.org To: Jamie Howard Cc: freebsd-hackers@freebsd.org, tech-userlevel@netbsd.org, tech@openbsd.org Subject: Re: Repalcement for grep(1) 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 On Sat, 3 Jul 1999, Jamie Howard wrote: : I also do not use mmap(), I treat the file as a simple stream : instead. My code is also a bit slower on larger files, but a bit faster : on smaller files. Sometimes I am an order of magnitude slower. I am : never that much faster. I think not using mmap is the reason, but I do : not know for certain. After the unified buffer cache modifications happen in the NetBSD kernel, the difference will be much less noticeable. : Now, I am having a problem though. I cannot figure out how to implement : -w and -x. For -x, I tried modifying the regular expression (foo) into : ^(foo)$ before compiling, but that did not work. I intended to do : something similar with -w. Anyway, I am probably missing the obvious, but : does anyone have any ideas regarding how I should implement -w and -x? Hm. Adding ^ and $ should work, provided you don't specify either REG_NOTBOL or REG_NOTEOL. (I assume that (foo) above, including the parens, is the RE. With the parens, it depends whether you're using standard REs or extended REs. :) Thatnks for this work ... I'll leave it to another soul to do something with it in NetBSD. -- -- Todd Vierling (tv@pobox.com) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message