Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!batcomputer!cornell!vax5.cit.cornell.edu!umh From: umh@vax5.cit.cornell.edu Newsgroups: comp.unix.questions Subject: Can I pass variables to rlogin? Message-ID: <1991Apr14.191051.4037@vax5.cit.cornell.edu> Date: 14 Apr 91 19:10:50 EDT Distribution: comp Organization: CIT, Cornell University Lines: 29 I am very surprised this is not part of FAQ? Is no-one else as ambitious as me? The problem is that we have a number of machines (Sun3, SparcStation, RS6000) on three different NFS networks, all running X-Windows. Now often one will try to rlogin from say an RS6000 to a Sparc in order to execute a Sparc binary. And well and good- we type rlogin host and get a terminal to the Sparc. However, if the binary we wish to execute is an X program we then have to type, at the Sparc, setenv DISPLAY rs6000:0, which becomes a right pain the 10 000th time you've done it. So my question to the net is how can one get around this? At present I have this really ugly kludge with temporary files that .login and .xinitrc look at and possibly change. This works so-so across a single NFS network, but to make it work across three requires rlogin be aliased to something with rcp in it, there are horrible synchroniztion problems- etc. The sort of nice way I'd like to do this would be either be able to pass environment variables to rlogin (like passing #defines to cc) so I could say rlogin host -Dfrom=`hostname` (then alias that, of course) failing something that general, can I at least somehow test in my .login if this .login is being started as an rlogin from a remote machine, and what that machine's name is? Or am I barking up the wrong tree? Is this nicely fixed by some X magic, not using UNIX at all? If anyone has been able to do something like this, please tell me. I'll summarize any methods I find, of general interest. Maynard Handley