> Hi all,
> I would like to obtain the PC client IP adress in a telnet session.
> I find a solution :
> =============
> TTY=`tty| cut -d/ -f3-5`
> who -a|grep "$TTY "|awk '{ print $8 }'
> But it's very slow and it's OK when I use it with the UNIX Prompt but
> it doesn't work when I call this script with Progress.
> Do you have another solution ?
> Could you help me ?
It depends a lot on how your systems are set up.
You might already have the information in an environment variable, such as
'REMOTEIP'.
You might have the IP address stored as part of the login record, and
available using the command 'who am i'
Often the reaon for asking this question is because you want to set up the
X display automatically. Older versions of telnet don't pass the DISPLAy
variable, but they do pass the 'TERM' variable. If this is the case, then
a common trick is to set TERM to $DISPLAY, and in your shell startup see
if there is a : in the TERM value. If so set DISPLAY to TERM, and set TERM
to a standard value (xterm, rxvt, ...)