- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- combinig o/p
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
тАО01-13-2010 09:25 PM
тАО01-13-2010 09:25 PM
i wrote one script to get the node details.
#!/usr/bin/sh
#Script to check the node details
Node=$(/opt/OV/bin/ovtopodump -lr|grep "NODE LABEL"|awk '{print $3}')
Int=$(/opt/OV/bin/ovtopodump -lr|grep "NUMBER OF INTERFACES")
Detail="$Node $Int"
echo "$Detail \c\n"
_______________________________
The o/p of this command is will be
Node=$(/opt/OV/bin/ovtopodump -lr|grep "NODE LABEL"|awk '{print $3}')
xyz.co.in
yyy.co.in
sss.co.in
ttt.co.in
and o/p of second command Int=$(/opt/OV/bin/ovtopodump -lr|grep "NUMBER OF INTERFACES")
is
interfaces 30
interfaces 120
interfaces 12
interfaces 44
what is my req is i want to display the o/p in one line
i.e
xyz.co.in interfaces 30
yyy.co.in interfaces 120
sss.co.in interfaces 12
but i am getting o/p as
xyz.co.in
yyy.co.in
sss.co.in
ttt.co.in interfaces 30
interfaces 120
interfaces 12
interfaces 44
please guide me to achieve this .
Thanks to all in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2010 10:05 PM
тАО01-13-2010 10:05 PM
Re: combinig o/p
paste file1 file2
outpur will be the one you want.
BR,
Kapil+
- Tags:
- paste
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2010 10:22 PM
тАО01-13-2010 10:22 PM
Re: combinig o/p
Thanks for the information.
It would be helpful if we combine the o/p without redirecting the result to another one and combibining it.
any way that was working.Thanks Once again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2010 10:32 PM
тАО01-13-2010 10:32 PM
Re: combinig o/p
Detail= paste $Node $Int
echo "$Detail \c\n"
this should work.
BR,
Kapil+
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-13-2010 11:09 PM
тАО01-13-2010 11:09 PM
Re: combinig o/p
It is not working, as it is not able to find the files.
Thanks & Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2010 03:01 AM
тАО01-14-2010 03:01 AM
Re: combinig o/p
You can probably do that if you use awk on the output of:
/opt/OV/bin/ovtopodump -lr | grep -e "NODE LABEL" -e "NUMBER OF INTERFACES"
Can you provide a sample of that that looks like?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-14-2010 03:35 AM
тАО01-14-2010 03:35 AM
Re: combinig o/p
Tech Mahindra
Data Canter Tubli Bahrain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2010 05:42 AM
тАО01-15-2010 05:42 AM
Re: combinig o/p
# /opt/OV/bin/ovtopodump -lr |
awk '/NODE LABEL/ {printf $3"\t"}
/NUMBER OF INTERFACES/ {print $0}'
maybe it's not perfect because it is untested. But there's no need to run ovtopodump twice and grep can also be done with awk. Tailor it to your own needs.
Unix operates with beer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-15-2010 07:02 PM
тАО01-15-2010 07:02 PM
Re: combinig o/p
Assuming they come out in that order, you could also use a variable so you only have one print:
... | awk '
/NODE LABEL/ { NODE = $3 }
/NUMBER OF INTERFACES/ { print NODE, $0 }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО01-17-2010 10:44 PM
тАО01-17-2010 10:44 PM
Re: combinig o/p
Thanks all,
can you please tell me how this command works
1. /opt/OV/bin/ovtopodump -lr|awk '/NODE LABEL/ { NODE = $3 } /NUMBER OF INTERFACES/ { print NODE, $0 }'
2.
/opt/OV/bin/ovtopodump -lr | awk '/NODE LABEL/ {printf $3"\t"}/NUMBER OF INTERFACES/ {print $0}'
It would be great helpful if you explain how this works.
Thanks a lot
both are giving the desired o/p.