![]() |
|
|
|
|
|||||||
| 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 |
| Development Releases: Linux Mint 4.0 Beta "Fluxbox", 4.0 Alpha "Debian" | iBot | UNIX and Linux RSS News | 0 | 01-04-2008 12:00 PM |
| Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`" | Lokesha | UNIX for Dummies Questions & Answers | 4 | 12-19-2007 10:52 PM |
| "syntax error at line 21 :'done' unexpected." error message" | ibroxy | Shell Programming and Scripting | 3 | 08-08-2007 03:45 AM |
| No utpmx entry: you must exec "login" from lowest level "shell" | peterpan | UNIX for Dummies Questions & Answers | 0 | 01-18-2006 01:15 AM |
| join two lines when the second line contains "US DOLLAR" | powah | Shell Programming and Scripting | 2 | 10-21-2005 03:30 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
get next 2 lines after a "pattern line"
all,
I want to get next 2 lines in a file after a define pattern, for example: SALT Input: Quote:
Quote:
Last edited by fongthai; 05-08-2008 at 11:14 PM. Reason: more info |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
try this:
Code:
sed -n -e '/SALT/ {n; p; n; p}' filename
Last edited by Yogesh Sawant; 05-09-2008 at 12:31 AM. Reason: corrected the sed command |
|
#3
|
|||
|
|||
|
It's great, Yogesh!
Thank for your help! |
|||
| Google The UNIX and Linux Forums |