[Ilugc] Grep two lines from text file with different A and B switch

  • From: shakthimaan@xxxxxxxxx (Shakthi Kannan)
  • Date: Fri, 27 Jul 2012 10:40:29 +0530

Hi,

--- On Fri, Jul 27, 2012 at 8:26 AM, Balasubramaniam Natarajan
<bala150985 at gmail.com> wrote:
| The problem with $grep "MD5 |Network Activity" -A5 */reports/report.txt* is
| that after all the search I am getting 5 lines however I wanted to know if
| we can make two different -A switches for a single Grep command.
\--

Tried the following?

  $ grep -A1 -e "MD5" -A2 -e "Network Activity" */reports/report.txt*

SK

-- 
Shakthi Kannan
http://www.shakthimaan.com

Other related posts: