- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to make grep to match start of line.
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
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
тАО03-22-2006 05:35 PM
тАО03-22-2006 05:35 PM
I am using this command
/opt/ignite/binpa/print_manifest.
It is showing very long output.
I want to search for string "HP" but, it should be at the start of the line only.
How can i use grep in this case?
Thanks & regards,
Prasad
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 05:38 PM
тАО03-22-2006 05:38 PM
Re: How to make grep to match start of line.
You can rather store output of /opt/ignite/binpa/print_manifest to a file and do a search with "vi". print_manifest gives a detailed output of all neccessary stuffs.
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 05:40 PM
тАО03-22-2006 05:40 PM
Re: How to make grep to match start of line.
grep -i '^HP' ->
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 05:40 PM
тАО03-22-2006 05:40 PM
Re: How to make grep to match start of line.
grep -i '^HP' -> To ignore case
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 05:45 PM
тАО03-22-2006 05:45 PM
Re: How to make grep to match start of line.
# /opt/ignite/binpa/print_manifest | grep -i '^HP'
Should be useful. But, look at everything in detail like,
# /opt/ignite/binpa/print_manifest | more
-Arun
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 05:46 PM
тАО03-22-2006 05:46 PM
Re: How to make grep to match start of line.
will give it.
^ - to give start of line.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 05:52 PM
тАО03-22-2006 05:52 PM
Solution/opt/ignite/binpa/print_manifest | grep -E "^[ ]*HP"
Will help.
You can use awk or perl or sed too.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-22-2006 06:22 PM
тАО03-22-2006 06:22 PM
Re: How to make grep to match start of line.
Thanks for instant replay.
This did the job
/opt/ignite/binpa/print_manifest | grep -E "^[ ]*HP"
Special thanks to Muthukumar
Thanks & regards.
Prasad