[comp.sys.sgi] Passing environment to rlogin session

browning@nas.nasa.gov (David S. Browning) (06/06/91)

From one machine (SGI 4D/60 running IRIX 3.3.1), I want to start two
seperate rlogin sessions on another machine, and I want the sessions
to start up differently.  Is there a way to:

1)  Provide an environment variable to the rlogin session which the
remote .login could check for?

or

2)  Provide a command to be executed by the remote host upon login?
Like BSD rsh, but retaining interactive terminal characteristics.

I want something like

	/usr/ucb/rsh remotehost emacs

but that gives me

	Please set the environment variable TERM; see tset(1).

(The remotehost is also an SGI, running IRIX 3.3.2.)  This is clearly
a job for X, but that must wait until IRIX 4.0.  I was hoping to pass
an environment variable in lieu of a command, but the man pages aren't
encouraging.  [SGI, any undocumented option to rlogin, like wsh -Z7
used to be?]

Please reply via e-mail.  I'll post a summary to the appropriate
group(s).  If it's an SGI NeWS feature/hack I'll spare comp.unix.*.

Many thanks,
David
--
|============================================================================|
| Internet:  browning@nas.nasa.gov                  Phone:  (415) 604-4321   |
| UUCP:  {hplabs, mailrus, ucbvax, etc.}!ames!amelia!browning                |
|----------------------------------------------------------------------------|
|"the nice thing about true hopelessness is that you don't have to try again"|
| -- jules shear                                                             |
|============================================================================|

browning@nas.nasa.gov (David S. Browning) (06/10/91)

Earlier I asked how to use /usr/ucb/rsh to run an interactive command
such as vi or emacs.  Alternatively, how could I pass an environment
variable to an rlogin shell to specify a command to start up upon
login?

I got many helpful replies.  The simplest (and therefore smartest,
IMHO) thing to do is to "hide" extra stuff in the TERM variable, since
this gets passed by rlogin.  The stuff can be extracted in the rlogin
shell by .login.

I was also told about the "expect" program by Don Libes, available
from durer.cme.nist.gov.  This looks like an impressive package, but
overkill for me given the simple solution above.

Here's an SGI-specific response that deserves to be read on
comp.sys.sgi:

------------------------------

>From: arc@kaibab.wpd.sgi.com (Andrew Cherenson)
To: browning@nas.nasa.gov
Subject: Re: Passing environment to rlogin session
Date: Fri, 7 Jun 91 16:06:34 -0700

The rlogin protocol doesn't allow for passing of environment variables.
The IRIX 4.0 telnet will let you send environment variables to a remote 
IRIS running IRIX 4.0 (or a host with a recent "Dave Borman" telnetd).

------------------------------

Many thanks to all who replied.

David

--
|============================================================================|
| Internet:  browning@nas.nasa.gov                  Phone:  (415) 604-4321   |
| UUCP:  {hplabs, mailrus, ucbvax, etc.}!ames!amelia!browning                |
|----------------------------------------------------------------------------|
|"the nice thing about true hopelessness is that you don't have to try again"|
| -- jules shear                                                             |
|============================================================================|