[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

rsh and (lack of) startup files



The strategy adopted by es of only reading the .esrc file if es is a
login shell seems reasonable much of the time, since subshells inherit
functions and variables through the environment.  However, when you
run `rsh machine command ...' this causes all sorts of troubles,
because you're only given a rather minimal path on the remote machine,
and the shell now does not source a file that you can use for the
purpose.  One workaround is to use the following little function in
place of rsh:

fn res host cmd {rsh $host . '.!' $cmd}

where .! is a mini version of my .esrc which executes its argument
vector after setting up the environment.

I am not really happy with this solution, though, since it requires me
to use different commands depending on whether es is my login shell on
the remote machine or not (as a rule, I use es as login shell only on
machines where I have root privileges).

I would welcome other suggestions on how to solve this sticky little
problem, as well as a discussion on whether es should always source a
file on startup (of course, it could do that in a predefined function
that the user may redefine, so no init files are sourced in a
subshell.  It could even redefine itself, so it only happens in
situations like the rsh, or similar situations).

- Harald

PS.  The silence has been deafening here lately.  Everybody holding
their breath waiting for a new version of es?  This could be dangerous
to your health!   :-)