I expect that echo is blocked here. Is it correct?
A command substitution is always processed before the "final" (in this case "outer") command is run.
So echo
is not "blocked", but is waiting for the command inside the command substitution to finish its execution, which never happens because the command itself spawns an ssh
interactive shell.
You can verify this in multiple ways, for example by hitting Ctrl+D, by typing exit
and hitting Enter or by opening another terminal instance and running:
pkill -15 -x ssh
As you can see, terminating the ssh
instance by any mean will let the command substitution finish its execution, finally letting the echo
command run on its output, which in this case is nothing.