- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- dynamically set the IP address in DISPLAY variable
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
тАО02-09-2009 11:07 AM
тАО02-09-2009 11:07 AM
dynamically set the IP address in DISPLAY variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 11:39 AM
тАО02-09-2009 11:39 AM
Re: dynamically set the IP address in DISPLAY variable
few way to do it.
HOSTNAME is already set.
So you can use nslookup or dig to get the ip address.
You will need to script it into a variable.
The exact data you want comes from ifconfig
In HP-UX ifconfig is a root only command and you need to give all users sudo permission to use it in order to do what you want.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 12:18 PM
тАО02-09-2009 12:18 PM
Re: dynamically set the IP address in DISPLAY variable
$> DISPLAY=$(who am i -R |sed -e "s/^.*(//" -e "s/)$/:0.0")
$> echo $DISPLAY
See if that works for you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 12:22 PM
тАО02-09-2009 12:22 PM
Re: dynamically set the IP address in DISPLAY variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 12:25 PM
тАО02-09-2009 12:25 PM
Re: dynamically set the IP address in DISPLAY variable
TwoProc meant to include a closing delimiter to his second 'sed' script:
# DISPLAY=$(who am i -R |sed -e "s/^.*(//" -e "s/)$/:0.0/")
Regards! :-)
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 12:37 PM
тАО02-09-2009 12:37 PM
Re: dynamically set the IP address in DISPLAY variable
Your scripts works only when the "who am I" return the whole ip address. Right now if I using Exceed CDE to login, "who am I" return whole ip. However, if I using telnet from windows command line to login, "who am I" only return ip address like ::ffff:172.16.12.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-09-2009 01:24 PM
тАО02-09-2009 01:24 PM
Re: dynamically set the IP address in DISPLAY variable
David, I didn't try with a Windows Telnet - sorry I just used ssh command. Which brings up the question... Why are you using telnet? Why is it still enabled on your server? From a security standpoint - it really should be turned off, and you should convert to ssh. You can download a free version of "putty" to get the same character based interface, and it CAN forward X11 data in the tunnel, so that you can still connect to your Exceed display.
I know that's not what you asked - just trying to pass on some advice. Feel free to ignore if you have circumstances that allow telnets use without risk.
Sadly, I can't test the problem using telnet for you, because I don't have any systems that have it turned on anylonger.
However, you *could* try just this one thing:
add your ip address to the HP server's /etc/hosts file. That way, instead of listing an IP address from "who am i -R" you'd get a machine name instead.On my server, if the server knows my machine name (via /etc/hosts, dns, whatever and however) it prints that instead of an IP address. And DISPLAY=urcomputer:0.0 or DISPLAY=urcomputer.urdomain.com:0.0 or DISPLAY=xxx.xxx.xxx.xxx:0.0 is all just as good as any of the others.
This last suggestion, at least to me - might stand a reasonable chance of working out for you via telnet, in combination with the fixed DISPLAY command that JRF posted.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2009 07:39 PM
тАО02-10-2009 07:39 PM