From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,2d8c8cd0ecd62bff X-Google-Attributes: gid1164f8,public From: yankus@ITD.Sterling.COM (Mike Yankus) Subject: Re: DISPLAY on Alpha/OSF Date: 1995/05/10 Message-ID: <3oqi83$d93@sparky.sterling.com>#1/1 X-Deja-AN: 102448297 references: <3oof1s$bn7@newshost.lanl.gov> organization: Sterling Software newsgroups: comp.sys.dec In article <3oof1s$bn7@newshost.lanl.gov>, John 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