context-grep
James A. Woods
jaw at eos.UUCP
Thu Feb 9 06:48:45 AEST 1989
# "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.
More information about the Comp.unix.questions
mailing list