I can't seem to set a new $PATH such that it is used when executing commands via ssh user@host command
. I have tried adding export PATH=$PATH:$HOME/new_path
to ~/.bashrc and ~/.profile on the remote machine, but executing ssh user@host "echo \$PATH"
shows that the change has not been picked up (it shows /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games). The remote machine is running Ubuntu 8.04.
I'm sure I could hack it into /etc/profile, but that's not a clean solution and it only works when one has root access.