SUMMARY: grep with a window

From: Mike Demarco <mdemarco_at_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
Received on Wed Jan 22 10:19:56 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:02 EST