Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
From: yankus@ITD.Sterling.COM (Mike Yankus)
Subject: Re: DISPLAY on Alpha/OSF
Date: 1995/05/10	[thread overview]
Message-ID: <3oqi83$d93@sparky.sterling.com> (raw)
In-Reply-To: 3oof1s$bn7@newshost.lanl.gov

In article <3oof1s$bn7@newshost.lanl.gov>, John Benner  <benner> wrote:
>Is there a way to automatically set the DISPLAY variable when logging
>into a remote Alpha running OSF? I log into an Alpha frequently from
>a variety of other machines (SGI's) and want to avoid manually
>setting the display to the machine I am logging in from. Any help would
>be appreciated.
>
Here is what I use in my .profile file.  It work for ALPHA OSF1, ULTRIX,
and some versions of SUN OS.

#
# set DISPLAY
#
if [ "$0" = "-ksh" ]
then
   #
   # FIXME: if you rsh from workstation A to server B, the DISPLAY is set
   # correctly, however, if you then rsh from server B to server B (or to
   # another workstation), then the display is set to server B, 
   #
   HOST=${DISPLAY%%:*}
   if [ -z "$HOST" ]
   then
      HOST=$(who am i | awk -F'(' '{ print $2 }')
      HOST=${HOST%%\)*}
      if [ -z "$HOST" ]
      then
         HOST=$(who -Mm | awk -F'(' '{ print $2 }')
	 HOST=${HOST%%\)*}
      fi 
      if [ -z "${DISPLAY}" ]
      then
         DISPLAY="${HOST}:0.0"
      fi
   fi
   export DISPLAY
fi
-- 
Mike Yankus                  INTERNET: Mike_Yankus@ITD.Sterling.COM             
PRC Inc.   1410 Wall St.     Phone:    (402) 291-8300 
Bellevue, NE. 68005-3687     FAX:      (402) 291-4362



      parent reply	other threads:[~1995-05-10  4:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-05-09  4:00 DISPLAY on Alpha/OSF John Benner
1995-05-09  4:00 ` Dan Pop
1995-05-10  4:00 ` Mike Yankus [this message]
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox