karln@uunet.uu.net (04/01/91)
I recently posted a question about rsh:
why does my rsh not work manually or in a program?
Thanks so Very Much to the four or five people who replied,
you know who you are and you helped. Here is a summary.
********************************************************************
Presumably you're setting your $path in the .login file - 'rsh host cmd'
doesn't do a login on the remote system; you need to set $path in .cshrc
(or give a full pathname for th cmd, of course) - if you have /bin/sh or
equivalent (rather than /bin/csh or equivalent) as login shell .cshrc
will of course not be of any help...
As to fixing the path problem, there are several solutions:
1) Set your path in .cshrc instead of .login (or both).
2) Set your path in .envrc, which is called from .login and/or .cshrc;
something like this:
=== .envrc ===
setenv ENVSET
set path=( . /usr/ucb /bin /usr/bin .....whatever.... )
setenv PRINTER myfavoriteprinter
...
==============
And add this to both your .login and .cshrc:
if ( ! $?ENVSET ) source .envrc
(or something similar)
I have used both solutions 1 & 2. SunOS is distributed with files in
/usr/lib/{Login,Cshrc} that use solution #1.
********************************************************************