- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- help in script
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
тАО06-24-2010 05:16 AM
тАО06-24-2010 05:16 AM
help in script
please help me on this
If i run this command
ovtopodump -lr
The o/p will be like this
INTERFACE DESCRIPTION: Loopback0
INTERFACE DESCRIPTION: Loopback1
INTERFACE DESCRIPTION: Serial0/2/0:0
INTERFACE DESCRIPTION: FastEthernet0/1
I need to automate this command
1.
2. INTERFACE DESCRIPTION should be compared, if yes then command should be executed.
Cheers!
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-24-2010 05:31 AM
тАО06-24-2010 05:31 AM
Re: help in script
To run a command with a list as you are asking could look something like:
# cat ./myrun
#!/usr/bin/sh
while read HOST
do
echo "HOST=${HOST}"
ovtopodump -lr ${HOST}|awk '/INTERFACE DESCRIPTION/'
done < ./myhosts
exit 0
...where the 'myhosts' file has lines of server hostname's, one per line.
You said:
> INTERFACE DESCRIPTION should be compared, if yes then command should be executed.
Compared to what? and what should be executed?
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2010 08:46 AM
тАО06-25-2010 08:46 AM
Re: help in script
Script right by Fergunson should work
Another option:
for i in `/tmp/myhost`
do
ovtopodump -lr $i|awk '/INTERFACE DESCRIPTION/'
done
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-25-2010 07:15 PM
тАО06-25-2010 07:15 PM
Re: help in script
>>for i in `/tmp/myhost`
It should be like this you forget the "cat"
for i in `cat /tmp/myhost`
do
ovtopodump -lr $i|awk '/INTERFACE DESCRIPTION/'
done
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-26-2010 12:03 PM
тАО06-26-2010 12:03 PM
Re: help in script
Or just toss the cat:
for i in $(< /tmp/myhost); do