![]() |
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 |
| Help with regexp | agasamapetilon | Shell Programming and Scripting | 7 | 09-20-2008 04:30 PM |
| Replace Entire line if any part matches regexp | Cocoabean | Shell Programming and Scripting | 6 | 09-14-2008 03:02 PM |
| RegExp: From first occurrance to last (at line start) | jjinno | Shell Programming and Scripting | 6 | 01-08-2008 04:04 PM |
| regexp to print after a field seperator | ramky79 | Shell Programming and Scripting | 7 | 05-09-2007 06:31 PM |
| regexp to get first line of string | jonas.gabriel | Shell Programming and Scripting | 3 | 05-09-2007 03:46 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
print the line immediately after a regexp; but regexp is a sentence
Good Day,
Im new to scripting especially awk and sed. I just would like to ask help from you guys about a sed command that prints the line immediately after a regexp, but not the line containing the regexp. sed -n '/regexp/{n;p;}' filename What if my regexp is 3 word or a sentence. Im using date as my starting point for my logs because its based on a tail alert log that updates daily. sample of it is below: Completed: ALTER DATABASE RECOVER CANCEL Starting ORACLE instance (normal) Thu Nov 13 12:41:34 2008 alter database mount standby database ORA-1100 signalled during: alter database mount standby database... Thu Nov 13 12:41:34 2008 ALTER DATABASE RECOVER standby database Media Recovery Start ORA-279 signalled during: ALTER DATABASE RECOVER standby database ... Thu Nov 13 12:41:36 2008 ALTER DATABASE RECOVER CONTINUE DEFAULT Thu Nov 13 12:41:36 2008 Media Recovery Log /oracle/P03/oraarch/P03arch1_7314.dbf Thu Nov 13 12:42:15 2008 ORA-279 signalled during: ALTER DATABASE RECOVER CONTINUE DEFAULT ... Thu Nov 13 12:42:15 2008 ALTER DATABASE RECOVER CONTINUE DEFAULT Thu Nov 13 12:42:15 2008 Media Recovery Log /oracle/P03/oraarch/P03arch1_7315.dbf Hope you could help me out because im really stuck here for my script. ![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|