[buug] Grep command

Clarke, John John.Clarke at LibertyMutual.com
Fri Sep 19 05:37:11 PDT 2003


Ha all,
I want to grab data from either side of a matched criteria from grep.
Any one got any other ideas of a command and if it does work please tell
me what OS and version and what shell.  Also if anyone does do this how
do you just get lines below or lines above the match rather than both.

This is what I am trying to do

Inputfile
A
B
C
D
E
F
G

Grep  -2 'D' inputfile
Expected result
 
B
C
D
E
F

Cheers,
John

DB2 - UDB DBA
RAM - Liberty Mutual
Ph(317) 581 8673
------------------------------------------------------------------------
-------------------------------------
CONFIDENTIALITY NOTICE: If you have received this e-mail in error,
please immediately notify the sender by e-mail at the address shown.
This e-mail transmission may contain confidential information. This
information is intended only for the use of the individual(s) or entity
to whom it is intended even if addressed incorrectly. Please delete it
from your files if you are not the intended recipient. Thank you for
your compliance. Copyright (c) 2003 Liberty Mutual
------------------------------------------------------------------------
-------------------------------------



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buug.org/pipermail/buug/attachments/20030919/2155f519/attachment.html>


More information about the buug mailing list