Yeah, I was wondering about PTY thingy (I think discussion subject was
who am I wIntegrate or something...).  
Our dumb terminals are connected to the DEC Terminal server, which start
telnet connection to the UniData host.  So in our environment, all our
interactive users use pty.

I've never used DC terminal emulator.  Does it understand wIntegrate
escape sequences?  If not, we may be able to do something like this:

UniBASIC code

001: PROMPT ""
002: EXECUTE "CONTROLCHARS ON"
003:
004: ASK.WINTY = CHAR(27):CHAR(1):"Enter stx:Version:esb":CHAR(13)
005: PRINT ASK.WINTY;  * Who are you?
006:
007: ECHO OFF
008: INPUT ANS.BACK FOR 5 ELSE ANS.BACK = "Unknown...";   * ANS.BACK
should contain wIntegrate version.
009: ECHO ON
010:
011: PRINT "ANS.BACK = ":ANS.BACK
012: EXECUTE "CONTROLCHARS OFF"


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ken Wallis
Sent: Thursday, May 03, 2007 6:33 PM
To: u2-users@listserver.u2ug.org
Subject: RE: [U2] What's My IP Address ?

[EMAIL PROTECTED] wrote:
>> -----Original Message-----
>> From: [EMAIL PROTECTED]
>> How do I get the client's IP address?
>
> On linux you can find this with the "who" command, but I don't know if
> it works on all *nixes.  This will work if your version of who
> supports it:
>
> EXECUTE 'SH -c "who am i"', OUT > WHO.AM.I
> MY.IP = FIELD (FIELD (WHO.AM.I, ')', 1), '(', 2)
>
> The IP will already be resolved to the host name if it's available via
> DNS or /etc/hosts.

On AIX its "who -Hum" to get your own line formatted from wtmp.

But I'd think the answerback approach makes more sense.  I'm not
familiar
with DC, but most emulators allow you to specify the string to send back
in
response to CTRL-E during session startup.  On a Unix host you should
have
this answerback string in $TERM when you start running /etc/profile and
~/.profile.  If those scripts are going to modify this before uv or udt
is
invoked, then just save it somewhere else:

export ANSWERBACK_TERM=$TERM

and then inside udt you'd just run a program that did a
GETENV("ANSWERBACK_TERM"), or in uv you might have to EXECUTE "SH -c
'echo
$ANSWERBACK_TERM'" CAPTURING.  Make your DC emulators answer differently
to
your wIntegrate ones and you are away.

One other point.  I couldn't understand how the malarchy with @TTY was
going
to help differentiate between DC and wIntegrate.  Sure it could help
work
out whether you had a telnet session or were on a real old terminal, but
both DC and wIntegrate will end up connected via a pseudo terminal.

Cheers,

Ken
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
u2-users@listserver.u2ug.org
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to