为什么这不起作用?:
hostname_A ~ % ssh -t hostname_B.local -- zsh --interactive -c echo "this works"
Connection to hostname_B.local closed.
hostname_A ~ %
Blarrrrrrr沮丧。
因为它应该是:
ssh -t hostname_B.local -- "zsh --interactive -c 'echo this works'"
哪个确实有效,就像这样:
hostname_A ~ % ssh -t hostname_B.local -- "zsh --interactive -c 'echo this works'"
this works
Connection to hostname_B.local closed.
hostname_A ~ %
耶!
(不过,在类似 bash 的语法中处理字符串转义的疯狂时,祝你好运。xD)