grep replacement

der Mouse mouse at mcgill-vision.UUCP
Fri Jun 10 19:32:23 AEST 1988


In article <1030 at sun.soe.clarkson.edu>, nelson at sun.soe.clarkson.edu (Russ Nelson) writes:
> In article <23133 at bu-cs.BU.EDU> bzs at bu-cs.BU.EDU (Barry Shein) writes:
>> In article <7944 at alice.UUCP> andrew at 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 at mcgill-vision.uucp
			arpa: mouse at larry.mcrcim.mcgill.edu



More information about the Comp.unix.wizards mailing list