Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!crdgw1!uunet!tiamat!jim From: jim@tiamat.fsc.com ( IT Manager) Newsgroups: comp.sys.hp Subject: Re: determining original host Keywords: rsh rlogin xhost hostname Message-ID: <822@tiamat.fsc.com> Date: 30 Mar 91 17:15:06 GMT References: <1970@news.tcs.com> Organization: Ahlstrom Filtration - Chattanooga,TN Lines: 34 In article <1970@news.tcs.com>, gwu@tcs.com (George Wu) writes: > > Okay, when I rlogin/rsh to my HP9000/400t, I'd like to know from which > machine I originated. The general idea is to set the DISPLAY variable such > that X applications use the display on my orignal machine. I'd also like to > use different stty settings, since keyboards sometimes differ. When using rsh, I just do: remsh otherhost "DISPLAY=$DISPLAY command" With rlogin, you could try to take advantage of rlogin passing the TERM variable to the remote host. A sequence like: on localhost: $ TERM=$TERM/$DISPLAY $ rlogin otherhost on otherhost (before the actual value of TERM is needed): DISPLAY=`echo $TERM | sed -e 's;^.*/;;'` TERM=`echo $TERM | sed -e 's;/.*$;;'` You could expand the whole notion and use appropriate code on each side of the connection to pass just about any values you wanted. Personally, I wish rsh and rlogin would just pass the entire environment, and let the remote host set it's own local stuff, with everything else remaining the same. ------------- James B. O'Connor jim@tiamat.fsc.com Ahlstrom Filtration, Inc. 615/821-4022 x. 651