Xref: utzoo comp.unix.wizards:9363 comp.unix.questions:7592 Path: utzoo!attcan!uunet!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: <23325@bu-cs.BU.EDU> Date: 14 Jun 88 16:25:57 GMT References: <7962@alice.UUCP> <4615@vdsvax.steinmetz.ge.com> <10989@cgl.ucsf.EDU> Organization: Boston U. Comp. Sci. Lines: 41 In-reply-to: seibel@cgl.ucsf.edu's message of 14 Jun 88 04:38:13 GMT The "tool philosphy" is not at question in this grep discussion, the question is whether grep is the right tool to provide contexts around pattern matches rather than resorting to some other tool later just for this special function. I claim putting it into grep is exactly right, the "tool philosophy" and parsimony arguments are red herrings, or reductio ad absurdum (why have grep echo file names when it's easy enough to do in a shell script? etc etc.) I've yet to hear an argument here against putting the context function into grep other than weak bleatings of parsimony. The argument in favor is obvious, GREP HAS THE $&^%$ CONTEXT IN ITS LITTLE HANDS, WHY LOOK FOR IT AGAIN? That is, it's just a minor generalization of what grep does right now, grep prints the context already, it's simply limited to one text line. If people think that filename:linenum is so swell why not have grep *only* produce that under all conditions? Ridiculous, right? The whole damn argument is ridiculous. Another anti-filename:linenum argument is what if I want to limit the output to LESS than a single line, like printing only the exact text matched? &c. I may not be exactly right here, I can see complications myself, but I think someone has to think slightly deeper than "heavens no, not another flag to grep" as the primary basis for software design, it's become the Mom and Apple Pie among some circles, excuses anything. It provides a convenient bludgeon to use on the novitiate. (tho I must agree some of these anti-tools arguments are appalling, the groans of carpetbaggers who would prefer to see their past failures replicated rather than learn why the system won, like the arriviste who keep moaning that C isn't more like Fortran or PL/1, I suspect some of them moaned about the distinct lack of manure in the streets when autos became popularized.) -Barry Shein, Boston University