- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Search for an expression and capture few lines...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2011 12:58 PM
тАО10-02-2011 12:58 PM
Hi All,
I have a file..my aim is to:
1. Search for the line containing a particular expression
2. Grab 3 lines above that expression
3. Grab 5 lines below that expression
Please let me know how can this be achieved?
Many a thanks..
Solved! Go to Solution.
- Tags:
- expression
- grep
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2011 03:25 PM
тАО10-02-2011 03:25 PM
SolutionHi:
You can roll your own or you can use a GNU 'grep'. See here for some ways to build your own:
See here for a GNU 'grep':
http://hpux.connect.org.uk/hppd/hpux/Gnu/grep-2.9/
If you chose to use the Porting Centre's offering, be sure to install the dependencies. This is easily done by first installing the 'depothelper' from there.
Regards!
...JRF...
- Tags:
- depothelper
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-05-2011 12:46 PM
тАО10-05-2011 12:46 PM
Re: Search for an expression and capture few lines above & below it
Also installed the GNU grep and its dependencies. That works like wow..