Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!pasteur!agate!eos!jaw From: jaw@eos.UUCP (James A. Woods) Newsgroups: comp.unix.questions Subject: Re: context-grep Message-ID: <2557@eos.UUCP> Date: 8 Feb 89 20:48:45 GMT References: <9176@burdvax.PRC.Unisys.COM> Organization: NASA Ames Research Center, California Lines: 18 # "Information is any difference that makes a difference." -- Gregory Bateson > I recall some time ago there was a discussion of some kind of > variation on grep that could be used to show, e.g., > all lines in a file containing "foo" occurring within, say, > 6 lines of a line containing "bar". > > Is there anything available that will do this? sure, GNU e?grep would handle this as: grep -6 bar file | grep foo thank mike haertel. it has been available via 'ftp' from prep.ai.mit.edu for quite some time. p.s. anyone using the original fast e?grep under the stead of 4.3-tahoe should switch to GNU grep now.