Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Bash: how to grep matches on two lines?

TheLonelyDBAOct 22 2015 — edited Oct 23 2015

Hi,

I have this:

expdp_errors=`grep -e "$day_to_check" $log_file |  grep -e 'ORA'`

The content of the logfile is that date is on one line and the ORA-error is on the line below.

How do I grep for both the date on line 1 and ORA on line 2?

Regards

This post has been answered by WadhahDaouehi on Oct 22 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2015
Added on Oct 22 2015
4 comments
1,045 views