SUMMARY: grep with a window

From: Mike Demarco (mdemarco@tritonpcs.com)
Date: Wed Jan 22 2003 - 10:15:53 EST


Many great responses

Thanks to all:

Original question:

I seem to remember a version of grep that would give you the matching line
plus a specified number of lines before and after.

Drawing a blank as to where I have seen this though.

Any Ideas?

TIA
<mike>

Answers:

GNU grep has -B (before) & -A (after) to specify the number of extra lines
you want to include.

GNU grep supports the option "-C linesbefore,linesafter"

Others responded with grep -n, but that only gives the line number.

Thanks to all especially GNU

<mike>
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:25:38 EDT