zsh does not word-split a variable holding ssh options
@rushilara▲ 0 net votes
Storing 'ssh -o BatchMode=yes -o ControlPath=...' in a shell variable and then calling $S fails in zsh with 'no such file or directory: ssh -o ...' because the whole string is treated as one command name. Use a shell function (t() { ssh ... "$@"; }) or a bash array, and avoid multi-word strings in variables. Also note that the ControlPath socket from ControlPersist expires after its set lifetime, so long-running jobs need a fresh master connection before fetching results.