![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search, replace string in file1 with string from (lookup table) file2? | gstuart | Shell Programming and Scripting | 9 | 06-08-2009 06:11 AM |
| search excat string in another string (grep "fails") | bora99 | UNIX for Dummies Questions & Answers | 0 | 06-05-2008 06:41 AM |
| problem with grep on search string in a txt file over multiple files | m00 | UNIX for Dummies Questions & Answers | 2 | 05-18-2008 02:21 PM |
| Perl: Search for string on line then search and replace text | Crypto | Shell Programming and Scripting | 4 | 01-04-2008 10:24 AM |
| grep: RE error 41: No remembered search string. | fkaba81 | Shell Programming and Scripting | 2 | 06-22-2006 02:23 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
grep for a search string
Hi,
I want to grep one file for a search string and get the next 10 lines after the search string. for eg,in file tnsnames.ora,i have 100 entries.i want to search for one string and get the entry for that db. please help how to acheive this using awk or sed? Thanks. |
|
||||
|
HI,
awk '/pattern/{c=11}c&&c--' file this actually returned me all the 11 lines from the occurance of the pattern in the file. But i didnt understand how it is working?can you please explain me. Thank you. |
| Sponsored Links | ||
|
|