I'm trying to start a program in the background on a remote server via ssh, but this program must be run from the directory it is contained within.
I tried doing the following
ssh -q user@server 'cd directory && command > /dev/null 2>&1 &'
But this results in the error
Ambiguous output redirect.
I am redirecting the output to /dev/null because otherwise the ssh call would not finish.
I have tried wrapping the command in {} and (), as well as with and without quotes but get the same error.
How can I work around this issue?
bash- are you sureuser's remote shell is not a different shell - perhapscsh?ssh -q user@server 'echo $version'command >& /dev/null(which, though deprecated also works inbash, but not in another bourne shells).