The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 01-02-2009
Rhije Rhije is offline
Registered User
  
 

Join Date: Dec 2008
Posts: 103
I have no idea what HP-UX 11.11 is.. but normal *nix shell, you can do:

grep -A2 "sometext" somefile.ext

It would grab that text, and the two lines afterwards.. You can also use -B for before.