![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| grep command | christine33990 | UNIX for Dummies Questions & Answers | 11 | 05-05-2008 11:45 PM |
| how to exclude the GREP command from GREP | yamsin789 | UNIX for Advanced & Expert Users | 2 | 10-04-2007 11:59 PM |
| grep command help | ishmael^soyuz | Shell Programming and Scripting | 4 | 07-11-2007 06:01 AM |
| grep command | pmsuper | UNIX for Dummies Questions & Answers | 6 | 11-22-2006 04:12 AM |
| grep command | debasis.mishra | Shell Programming and Scripting | 1 | 03-27-2006 10:53 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#8
|
|||
|
|||
|
Code:
grep -A 2 'ERROR' file |
| Forum Sponsor | ||
|
|
|
#9
|
||||
|
||||
|
Quote:
|
|
#10
|
||||
|
||||
|
Try...
Code:
awk '/ERROR/{c=3};c-->0' file
|
|
#11
|
|||
|
|||
|
Code:
sed -n "/^ERROR/{N;N;N;p;}" file
|
|
#12
|
||||
|
||||
|
Anbu23,
Great solution! There is only one minor issue that it is very easy to resolve. It is displaying four lines, instead of 3 including the "ERROR" line per Geekeezoid specs. |
|
#13
|
|||
|
|||
|
Thanks for all the replies and suggestions.. will try all of them when i have some free time today... thanks again
|
|
#14
|
|||
|
|||
|
Quote:
This worked... thanks... yes there was only a minor issue.. but it definitely did its job... thanks alot guys... |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | |
| Display Modes | |
|
|