TL;DR
This works:
ssh [email protected]
$ qconfig
But these do not work (which makes no sense to me, as they should be the same):
ssh [email protected] qconfig
sh: qconfig: cannot execute - No such file or directory
or
ssh [email protected]
$ sh
$ qconfig
sh: qconfig: cannot execute - No such file or directory
I want to use ssh [email protected] "some; commands; including; qconfig". How?
Long Version
I have a command which I would like to submit to a remote host via a non-interactive ssh command or from sh sub-shell, but it is not found when submitted that way even though it is found during a normal, interactive session.
Details:
OS: QNX
Shell: sh
Interactive command in which everything works as expected:
ssh [email protected]then supplyqconfigat promptthough if I do
shthenqconfigat this point, it does not work in that sub-shellNon-interactive command in which things do not work:
ssh [email protected] qconfig
Example:
[me.LOCAL-PC] > ssh [email protected]
[email protected]'s password:
remotehost:/home/me $ echo $SHELL
/bin/sh
remotehost:/home/me $ qconfig
<…> (it works fine here)
remotehost:/home/me $ sh
remotehost:/home/me $ qconfig
sh: qconfig: cannot execute - No such file or directory
remotehost:/home/me $ exit
remotehost:/home/me $ sh -c qconfig
sh: qconfig: cannot execute - No such file or directory
remotehost:/home/me $ exit
[me.LOCAL-PC] > ssh [email protected] qconfig
[email protected]'s password:
sh: qconfig: cannot execute - No such file or directory
I'm not very familiar with QNX, so I wasn't sure if qconfig was a built-in or not. It would make sense that it is since qconfig is not on my PATH, and if I do which qconfig it says which: no qconfig in /usr/bin:/bin:<…>.
I have since seen that there is a QNX qconfig as seen at this link, but I'm not so sure that's what is executing even when it does work for me since the one I am using does not accept the command line options listed at that page - I tried -a, -b, and -c and it said -a: No such file or directory.
What are the differences that could cause such a problem? More importantly, how do I get the ssh [email protected] <command> shell to correctly use the command the same as the ssh [email protected] shell does?