I have a need to be able to determine my IP address on unix. When you login, the environment variable DISPLAY is set to "my" IP address. But, when you “rlogin”, “telnet”, etc, to another box, the DISPLAY variable is not set. I have investigated several commands including “netstat” and “ifconfig”, but none returned my IP address. “ifconfig” might be able to return my IP address, but I am not privileged to use all options.
I searched the internet for a solution. All “solutions” returned the host IP address or used variations of “ifconfig” that I am privileged to use.
The reason for the need is Tcl/Tk uses the DISPLAY environment variable to determine where to send the GUI output. When I login, I can manual determine my IP address. Then when I “rlogin” to another box, I can manually set the DISPLAY environment variable. This works fine for me, but the users, who are not as familiar with UNIX, will have a problem.
The solution can be in the form of a command, utility, or a programming method.
I searched the internet for a solution. All “solutions” returned the host IP address or used variations of “ifconfig” that I am privileged to use.
The reason for the need is Tcl/Tk uses the DISPLAY environment variable to determine where to send the GUI output. When I login, I can manual determine my IP address. Then when I “rlogin” to another box, I can manually set the DISPLAY environment variable. This works fine for me, but the users, who are not as familiar with UNIX, will have a problem.
The solution can be in the form of a command, utility, or a programming method.