When I run on linux-system/bash:
sleep 10 &
I get bash prompt immediately.
But when I run:
ssh linux-system 'sleep 10 &'
I wait 10 seconds.
Two questions:
Can I find explanation in ssh/bash documentation ?
By changing context/configuration, can we make ssh to return immediately, without changing the command
sleep 10 &
itself? for example :
ssh linux-system 'change-bash-configuration; sleep 10 &'
or
ssh -some-ssh-options linux-system 'sleep 10 &'
Update 1
We can use ssh -f
to get the prompt, but a background ssh
process still waits for remote process to finish. So my questions remain.
Update 2
To clarify, I want local ssh
process to terminate (not waiting for 10 seconds in the background) after starting remote job in the background.