Xref: utzoo comp.unix.wizards:9428 comp.unix.questions:7630 Path: utzoo!attcan!uunet!yale!husc6!bu-cs!bzs From: bzs@bu-cs.BU.EDU (Barry Shein) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: Tool -flag considered harmful (was: grep replacement) Message-ID: <23381@bu-cs.BU.EDU> Date: 16 Jun 88 14:54:53 GMT References: <7962@alice.UUCP> <4615@vdsvax.steinmetz.ge.com> <10989@cgl.ucsf.EDU> <23325@bu-cs.BU.EDU> <7985@alice.UUCP> Organization: Boston U. Comp. Sci. Lines: 23 In-reply-to: andrew@alice.UUCP's message of 15 Jun 88 17:35:37 GMT From andrew@alice >there are some technical problems with printing context, particluarly >if you want regular expreesion-defind contexts. it means you have to be >able to run the sodding regexp stuff backwards thru the text. it also >means keeping a lot of buffer which is more than a little repugnant. Why not look for "starts" as you search forward and (re)start buffering from there? No need to search backwards after the match, in fact it would be counter-productive (either you need to seek a pipe or save everything, of course saving a seek pointer to last start on streams that support it might be a rational optimization, but it's not necessary if you save starts as you go.) I don't know what "repugnant" means in any context that can be answered. >despite all this, it is feasible but not trivial to add context stuff. >i won't do it though. Of course, that is your decision, I was just trying to provide helpful comments as was requested. -Barry Shein, Boston University