Path: utzoo!attcan!uunet!wuarchive!cs.utexas.edu!radar!duanev From: duanev@radar.ACA.MCC.COM (Duane Voth) Newsgroups: comp.windows.x Subject: Re: rlogin and the DISPLAY variable Summary: overload $term Message-ID: <1340@kauai.ACA.MCC.COM> Date: 18 Oct 90 21:15:35 GMT References: Organization: MCC ACT Program, Austin, TX Lines: 48 In article , mike%aleytys@UUNET.UU.NET (Michael Kent) writes: > I need to rlogin to a remote X Workstation from my local X Workstation, > and have the DISPLAY environmental variable properly... > > Having the user's profile > set DISPLAY is out, as the user can be logging in from several different > local machines. I've successfully been overloading $term. I can start from any machine, rlogin as far as I want, and the new shell will always set $DISPLAY to the machine I started from. This works fine so long as all target accounts contain .cshrc code to reset $TERM before it is used for anything. If you are a sysop this shouldn't be a problem. Sorry, sh/ksh/bash users, I've not tried this with other shells. Here are the useful parts of a .cshrc: -------------------- if ( "$term" =~ *%* ) then # check for special variables eval `echo $term | sed '/[0-9A-Za-z]*%/s///'` set term=`echo $term | sed '/%.*/s///'` endif alias _to 'set term=${term}%\!*' if ($term == "xterm") then if ($?RDISPLAY) then if ( "$RDISPLAY" =~ ${hostname}* ) then setenv DISPLAY unix:0 else setenv DISPLAY $RDISPLAY echo "remote display $RDISPLAY" endif else setenv DISPLAY unix:0 setenv RDISPLAY ${hostname}:0 endif alias rlogin '(_to "setenv RDISPLAY $RDISPLAY"; /usr/ucb/rlogin \!*)' endif -------------------- -- --- duane voth duanev@mcc.com ---- {uunet,harvard,gatech,pyramid}!cs.utexas.edu!milano!pp!duanev --- ALL systems are arbitrary! Effectiveness is the measure of Truth --