Article 134953 of comp.os.vms:
Newsgroups: comp.os.vms
Path: nntpd.lkg.dec.com!crl.dec.com!crl.dec.com!bloom-beacon.mit.edu!apollo.hp.com!lf.hp.com!news.dtc.hp.com!col.hp.com!usenet.eel.ufl.edu!brutus.bright.net!chi-news.cic.net!newsfeed.internetmci.com!EU.net!CERN.ch!mxsld2.pd.infn.it!LORETI
From: loreti@mxsld2.pd.infn.it (Maurizio Loreti)
Subject: Re: terminal info in DCL or C script
X-Nntp-Posting-Host: mxsld2.pd.infn.it
Message-ID: <DIr7wK.ACq@news.cern.ch>
Sender: news@news.cern.ch (USENET News System)
Reply-To: loreti@mxsld2.pd.infn.it
Organization: I.N.F.N. Padova - CDF/CMS VAXcluster
References: <30B94A13.622A@mprgate.mpr.ca>
Date: Tue, 28 Nov 1995 12:55:30 GMT
Lines: 36

In article <30B94A13.622A@mprgate.mpr.ca>, Brent Routley <routley@mprgate.mpr.ca> writes:
>I need the terminal info shown by the 'show term' and 'sho users/full'
>commands that indicates from what machine a user has logged on to our OpenVMS machine. For 
>instance, for the user SFULIB1, I want the string  "lib4m07.lib.sfu.ca" (see output of 'sho 
>users/full SFULIB1' below.)

I wrote some time ago a DCL command procedure to automatically set
display to the calling node; you can access the information with
F$GETDVI.  Here is my procedure; hope that helps...

N.B.: If you experts find an error in this procedure, please EMail
      me in addition to post...
---------------------------------Begin file: DISP.COM
$! MLO 1995-06-21
$!
$ remote = F$GETDVI("TT:", "TT_ACCPORNAM")
$ rlen = F$LENGTH(remote)
$ If F$LOCATE("::", remote) .ne. rlen
$   then
$     remote = F$ELEMENT(0, ":", remote)
$     disp := set display/create/transport=decnet/node="""''remote'"""
$   else
$     if F$LOCATE("Host", remote) .ne. rlen
$       then
$         remote = F$ELEMENT(1, " ", remote)
$       endif
$     remote = remote - "[" - "]"
$     disp := set display/create/transport=tcpip/node="""''remote'"""
$   endif
$ write sys$output "--> " + disp
$ 'disp'
$ exit
---------------------------------End file: DISP.COM

Maurizio Loreti                       http://mvxpd5.pd.infn.it/wwwcdf/mlo.html
Un. of Padova, Dept. of Physics - Padova, Italy          loreti@padova.infn.it


