Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to use grep to get context after and before matching lines

Status
Not open for further replies.

pneely

MIS
Apr 3, 2001
23
US
My variants of grep (Solaris 7) does not understand the following options:
-A NUM, --after-context=NUM
Print NUM lines of trailing context after matching lines.
-B NUM, --before-context=NUM
Print NUM lines of leading context before matching lines.

How else can I get a number of lines before and after the matching lines ?
 
Yes, thank you..the GNU version worked well. Thanks for responding......
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top