Xref: utzoo comp.unix.wizards:9185 comp.unix.questions:7483 Path: utzoo!dciem!nrcaer!scs!spl1!laidbak!att!pacbell!ames!killer!osu-cis!tut.cis.ohio-state.edu!mandrill!hal!ncoast!allbery From: allbery@ncoast.UUCP (Brandon S. Allbery) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Message-ID: <7869@ncoast.UUCP> Date: 4 Jun 88 21:14:27 GMT Article-I.D.: ncoast.7869 References: <7882@alice.UUCP> <5630@umn-cs.cs.umn.edu> <6866@elroy.Jpl.Nasa.Gov> <2312@bgsuvax.UUCP> Reply-To: allbery@ncoast.UUCP (Brandon S. Allbery) Followup-To: comp.unix.wizards Organization: Cleveland Public Access UN*X, Cleveland, Oh Lines: 23 As quoted from <2312@bgsuvax.UUCP> by kutz@bgsuvax.UUCP (Kenneth Kutz): +--------------- | In article <6866@elroy.Jpl.Nasa.Gov>, alan@cogswell.Jpl.Nasa.Gov (Alan S. Mazer) writes: | > One thing I would _love_ is to be able to find the context of what I've | > found, for example, to find the two (n?) surrounding lines. I have wanted | > to do this many times and there is no good way. +--------------- grep -n foo ./bar | context 2 I posted context to net.sources back when it existed; someone may still have archives from that time, if not I'll retrieve my sources and repost it. It takes lines of the basic form filename ... linenumber : ... and displays context around the specified lines. I use this with grep quite often; it also works with cc (pcc, not Xenix cc) error messages. -- Brandon S. Allbery | "Given its constituency, the only uunet!marque,sun!mandrill}!ncoast!allbery | thing I expect to be "open" about Delphi: ALLBERY MCI Mail: BALLBERY | [the Open Software Foundation] is comp.sources.misc: ncoast!sources-misc | its mouth." --John Gilmore