So I'm trying to run a script remotely on ssh such as ssh remote "~/bin/some_script.sh"
however the problem is that the script runs a command vcs
that seems to not load when I try to just send the command via ssh, as opposed to ssh'ing into the remote and manually executing the command.
For clarity, the following output apears when I try
$ ssh remote "cd/...; vcs -x -...;"
bash: vcs: command not found
but it works when I do
$ ssh remote
remote$ vcs -x -...
remote$ //good output
I looked more into it and when I simple run
$ ssh remote "compgen -c | wc -l"
2611
vs
$ ssh remote
remote$ compgen -c | wc -l
3735
So clearly there are a lot of commands not being "loaded" when I just pass commands via ssh vs when I actually ssh into remote and execute commands. Any idea what is happening and how to overcome this?
Best Answer
This has been asked and answered many times elsewhere, including:
and many others. I think the first one is the best answer I found in a few seconds of looking