From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f678f,1f09d711aef7356a X-Google-Attributes: gidf678f,public X-Google-Thread: fee84,1f09d711aef7356a X-Google-Attributes: gidfee84,public X-Google-Thread: 1020c6,1f09d711aef7356a X-Google-Attributes: gid1020c6,public X-Google-Thread: 10b6ac,1f09d711aef7356a X-Google-Attributes: gid10b6ac,public From: "Alan J. Wylie" Subject: Re: [Q] X remote display detection on login Date: 1998/10/21 Message-ID: <362D9D8B.A2696134@cyrano.com>#1/1 X-Deja-AN: 403547982 Content-Transfer-Encoding: 7bit X-NNTP-Posting-Host: psldev.demon.co.uk:158.152.145.235 References: <362D0E43.7D5D@boeing.com> To: john.s.haro@boeing.com X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 908977340 nnrp-05:11278 NO-IDENT psldev.demon.co.uk:158.152.145.235 Organization: Cyrano (UK) Ltd. Mime-Version: 1.0 Newsgroups: comp.unix.admin,comp.unix.osf.osf1,comp.windows.x.motif,comp.unix.osf.misc John Stephen Haro wrote: > > Anyone have a chuck of a .login script for DUX4.0D they can zing me that > will set the DISPLAY variable automatically on remote login? > The following (korn/bash) script works for me, across all the common platforms. Are you really still using csh? - Translation left as an exercise for the reader. The who in /usr/local/bin would be the gnu one. As it is one of those code fragments that, like topsy, just grow, It could probably be greatly improved. Hope this helps ------------------------------ if [ -z "$DISPLAY" ] then if [ `which who` = "/usr/local/bin/who" ] then DISPLAY=`who am i` else case `uname` in HP-UX) DISPLAY=`who -R am i` ;; OSF1) DISPLAY=`who -M am i` ;; *) DISPLAY=`who am i` esac fi DISPLAY=`IFS="()" ; set $DISPLAY; echo $2` case `uname` in AIX|Linux) # truncated to 16 chars, so strip off domain DISPLAY=`echo $DISPLAY | sed 's/\..*//'` ;; esac DISPLAY=$DISPLAY:0.0 export DISPLAY echo "export DISPLAY=$DISPLAY" fi ------------------------------ -- Alan J. Wylie (Cyrano UK Ltd.) | mailto:awylie@cyrano.com http://www.cyrano.com | http://www.zen.co.uk/home/page/alan.wylie It's much easier to design in reliability, then add in ease of use, than the other way round.