[Beowulf] Confusion about login, non-interactive, interactive shells
hahn at mcmaster.ca
Wed Sep 26 11:52:04 PDT 2012
> $ ssh node4 echo $PATH
as others have mentioned, this probably doesn't do what you think
unless you prevent your local shell from expanding $PATH:
ssh node4 'echo $PATH'
ssh node4 echo \$PATH
ssh node4 printenv PATH
I tend to prefer the latter, since it seems less fragile.
ssh also has a default PATH, selected at compile time, which is
used for non-interactive invocations. if you ssh interactively,
you get normal login-shell behavior, which can result in a very
different PATH. there is also some skew in versions of bash
about how they initialize the environment - so for instance,
"module load" commands may not be invoked if you "ssh node command".
> b) how come there is a difference between echo $PATH and which mpirun ? It
I guess you'll see the same results if you use "printenv PATH" either
via ssh directly or through mpirun.
More information about the Beowulf