Xref: utzoo comp.unix.wizards:9226 comp.unix.questions:7507 Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.unix.wizards,comp.unix.questions Subject: Re: grep replacement Message-ID: <1149@mcgill-vision.UUCP> Date: 10 Jun 88 09:32:23 GMT References: <136@rubmez.UUCP> <449@happym.UUCP> <7944@alice.UUCP> <1030@sun.soe.clarkson.edu> Organization: McGill University, Montreal Lines: 19 In article <1030@sun.soe.clarkson.edu>, nelson@sun.soe.clarkson.edu (Russ Nelson) writes: > In article <23133@bu-cs.BU.EDU> bzs@bu-cs.BU.EDU (Barry Shein) writes: >> In article <7944@alice.UUCP> andrew@alice.UUCP writes: >>> the right thing to do is to write a context program that takes >>> input looking like "filename:linenumber:goo" and prints whatever >>> context ... >> Almost, unless the original input was produced by a pipeline, [...] >> unless you tee the mess to a temp file, yup, mess is the right word. > How about: > alias with_context tee >/tmp/$$ | $* | context -f/tmp/$$ This assumes that (a) there's room on /tmp to save the whole thing and (b) that you don't mind rereading it all to find the appropriate line. Both assumptions are commonly violated, in my experience. der Mouse uucp: mouse@mcgill-vision.uucp arpa: mouse@larry.mcrcim.mcgill.edu