rsh environment

Dave Cohrs dave at cs.wisc.edu
Fri Dec 23 06:47:34 AEST 1988


> Is there any way to alter the default environment setting used when
> rsh (the bsd remote shell) executes commands?

Are you *sure* you're using the BSD rsh (don't forget about the rshd
on the remote side), and not some Wollongong hacked up version that runs
on a SysV machine?  Seeing that LOGNAME in your environment leads me to
wonder...

The rsh I use between two real BSD systems gives me an environment with
HOME, SHELL, PATH, and USER, and, because I use /bin/csh for a shell,
runs my .cshrc, which sets whatever other environment variables I want.

SysV's /bin/sh only runs your /etc/profile or your own .profile when
you log in, and a remote shell is not the same thing as logging in.
I guess if the remote machine is not a real BSD machine, or your shell
is csh, you can't easily change your environment.  You can, of course
rsh a command like (assume your remote shell is /bin/sh or ksh):

	rsh somemachine "FOO=$FOO command args"

and set one or more remote envariables to be the same as they were on
your local shell (assuming you had a envariable FOO in your local shell).
The variations on this theme are endless.  You can also:

	rsh somemachine ". .profile ; command args"

There are no provisions in the rsh protocol to automatically copy your
environment to the remote shell.

dave cohrs
--
Dave Cohrs
+1 608 262-6617                        UW-Madison Computer Sciences Department
dave at cs.wisc.edu                       ...!{harvard,rutgers,ucbvax}!uwvax!dave



More information about the Comp.unix.wizards mailing list