- Community Home
- >
- Servers and Operating Systems
- >
- Legacy
- >
- Operating System - Tru64 Unix
- >
- Re: Usage of ECHO and grep commands
Operating System - Tru64 Unix
1753416
Members
7180
Online
108793
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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-21-2008 02:21 AM
тАО10-21-2008 02:21 AM
Re: Usage of ECHO and grep commands
Hi Dennis,
I tried below way as you told,but i didnt get any output.
==========================================
set -A TELNET_HOST_ARR ${telnet_host_str}
telnet_host_str="alden porthos million athos moe moronica mullins 15.146.231.62 15.146.230.119"
target_system=groucho
ipaddress=$(nslookup ${target_system} |grep -p ${target_system} | grep Address | awk '{print $2}')
status=$(echo $telnet_host_str | grep $target_system | grep $ipaddress)
# echo $status
#
=========================================
Since i kept ipaddress value in telnet_host_str array so am expecting that ipaddress value as output in status variable.
If i keep target_system value in telnet_host_str array then i may expect that output in status variable..
So what i want is it should handle both situations apropriately..
So please help me in changing below code:-
status=$(echo $telnet_host_str | grep $target_system | grep $ipaddress)
Thanks,
Shammer
I tried below way as you told,but i didnt get any output.
==========================================
set -A TELNET_HOST_ARR ${telnet_host_str}
telnet_host_str="alden porthos million athos moe moronica mullins 15.146.231.62 15.146.230.119"
target_system=groucho
ipaddress=$(nslookup ${target_system} |grep -p ${target_system} | grep Address | awk '{print $2}')
status=$(echo $telnet_host_str | grep $target_system | grep $ipaddress)
# echo $status
#
=========================================
Since i kept ipaddress value in telnet_host_str array so am expecting that ipaddress value as output in status variable.
If i keep target_system value in telnet_host_str array then i may expect that output in status variable..
So what i want is it should handle both situations apropriately..
So please help me in changing below code:-
status=$(echo $telnet_host_str | grep $target_system | grep $ipaddress)
Thanks,
Shammer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2008 02:29 AM
тАО10-22-2008 02:29 AM
Re: Usage of ECHO and grep commands
>I tried below way as you told,but i didn't get any output.
Do you want AND or OR for the two conditions?
See your other thread for OR.
>should handle both situations appropriately.
It seems like you want OR.
Do you want AND or OR for the two conditions?
See your other thread for OR.
>should handle both situations appropriately.
It seems like you want OR.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-22-2008 04:58 AM
тАО10-22-2008 04:58 AM
Re: Usage of ECHO and grep commands
OK Thanks Dennis..
- « Previous
-
- 1
- 2
- Next »
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP