Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!ux1.cso.uiuc.edu!midway!mimsy!mojo!stripes From: stripes@eng.umd.edu (Joshua Osborne) Newsgroups: comp.windows.x Subject: Re: Setting up DISPLAY environment variable Message-ID: <1990Jun30.060904.8241@eng.umd.edu> Date: 30 Jun 90 06:09:04 GMT References: <9173@uswat.UUCP> Sender: news@eng.umd.edu (The News System) Organization: College of Engineering, Maryversity of Uniland, College Park Lines: 28 In article <9173@uswat.UUCP> bar@uswat.uswest.com (Bala Ramakrishnan 595-2868) writes: >I run X11R4 on a sun 3/80. Also, I run some Xclients on a Sparc server by >rlogin to the sparc machine. My home directories are mounted on both the >Sun 3/80 and the sparc machine. > >My .cshrc file has : setenv DISPLAY localhost:0 Why not just set it once in .login? [...] >Is there a way (say by executing a program) to inquire the sparc machine >where Iam rlogged from ,so that I can set the DISPLAY variable >to the internet address of the machine from which I rlogged automatically. From my .login: set from=`who am i | cut -d\( -f2 | cut -d. -f1` if (`tty` == /dev/console) then setenv DISPLAY `hostname`:0 else setenv DISPLAY "${from}":0 endif This doesn't allways work. It works for one hop & for a console login. -- stripes@eng.umd.edu "Security for Unix is like Josh_Osborne@Real_World,The Mutitasking for MS-DOS" "The dyslexic porgramer" - Kevin Lockwood "Don't try to change C into some nice, safe, portable programming language with all sharp edges removed, pick another language." - John Limpert