Computing.Net > Forums > Unix > grep -A or -B in Sun os 9

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

grep -A or -B in Sun os 9

Reply to Message Icon

Name: johan
Date: September 9, 2004 at 02:55:01 Pacific
OS: solaris 9
CPU/Ram: 1
Comment:

Linux has grep command with -A or -B options. ( print n. lines -After or -Before context ) Any command like this in Solaris 9



Sponsored Link
Ads by Google

Response Number 1
Name: vicchai
Date: September 9, 2004 at 05:35:07 Pacific
Reply:

Maybe you can try something like this:

ex -R file.txt << !
g/pattern/.-2,.+3p
q
!


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: grep -A or -B in Sun os 9

Greb -A or -B www.computing.net/answers/unix/greb-a-or-b/7179.html

search file www.computing.net/answers/unix/search-file/5794.html

NEEDED CRYSTAL LAN DRIVER FOR SUN OS 2.5.1 www.computing.net/answers/unix/needed-crystal-lan-driver-for-sun-os-251/68.html