- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Using grep to get some information
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
Forums
Discussions
Discussions
Discussions
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
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
04-06-2010 09:10 AM
04-06-2010 09:10 AM
MT_slot_1 EMPTY
IE_slot_1 EMPTY
IE_slot_2 EMPTY
DT_slot_1 EMPTY
DT_slot_2 EMPTY
DT_slot_3 EMPTY
DT_slot_4 EMPTY
ST_slot_1 FULL CLN001
ST_slot_2 FULL 568
ST_slot_3 FULL 569
ST_slot_4 FULL 566
ST_slot_5 FULL 576
ST_slot_6 FULL 570
ST_slot_7 FULL 571
ST_slot_8 FULL 572
ST_slot_9 FULL 573
ST_slot_10 FULL 574
ST_slot_11 FULL 575
ST_slot_12 FULL 538
ST_slot_13 FULL 532
ST_slot_14 FULL 524
ST_slot_15 FULL 523
ST_slot_16 FULL 522
ST_slot_17 FULL 521
ST_slot_18 FULL 520
ST_slot_19 FULL 519
ST_slot_20 FULL 518
for example
mc -p /dev/rac/c13t0d0 -rDISM | grep ST_slot_/[1-2]
returns --
ST_slot_1 FULL CLN001
ST_slot_2 FULL 568
ST_slot_10 FULL 574
ST_slot_11 FULL 575
ST_slot_12 FULL 538
ST_slot_13 FULL 532
ST_slot_14 FULL 524
ST_slot_15 FULL 523
ST_slot_16 FULL 522
ST_slot_17 FULL 521
ST_slot_18 FULL 520
ST_slot_19 FULL 519
ST_slot_20 FULL 518
ST_slot_21 FULL 517
ST_slot_22 FULL 516
ST_slot_23 FULL 515
ST_slot_24 FULL 514
ST_slot_25 FULL 513
ST_slot_26 FULL 537
ST_slot_27 FULL 536
ST_slot_28 FULL 535
ST_slot_29 FULL 534
Any help would be great. I have attached a txt document with some of the above if anyone wants to give it a try.
Solved! Go to Solution.
- Tags:
- grep
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2010 09:18 AM
04-06-2010 09:18 AM
Re: Using grep to get some information
mc -p /dev/rac/c13t0d0 -rDISM | grep ST_slot_[1-2]
mc -p /dev/rac/c13t0d0 -rDISM | grep -e ST_slot_1 -e ST_slot_2
mc -p /dev/rac/c13t0d0 -rDISM | grep ST_slot_[10-20]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2010 09:21 AM
04-06-2010 09:21 AM
SolutionI'd probably use 'sed', 'awk' or Perl and look for ranges as you appear to want:
# sed -ne '/slot_1[ ]/,/slot_10/p' file
# sed -ne '/slot_10[ ]/,/slot_20/p' file
...or if you only want the "FULL" and not the "EMPTY" ones:
# sed -ne '/slot_1[ ]F/,/slot_10/p' file
I used the '[ ]' to surround a space for readability, here.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2010 10:39 AM
04-06-2010 10:39 AM
Re: Using grep to get some information
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2010 03:23 PM
04-06-2010 03:23 PM
Re: Using grep to get some information
mc -p /dev/rac/c13t0d0 -rDISM |
grep -e "ST_slot_[1-9] " -e "ST_slot_1[0-9] " -e "ST_slot_20 "
>JRF: I'd probably use 'sed', 'awk' or Perl and look for ranges as you appear to want:
I think the ranges are in the patterns and not the data?