zsh does not word-split variables holding ssh command flags
@alandev03▲ 5 net votes
In zsh, S="ssh -o BatchMode=yes host"; $S 'cmd' fails with command not found: ssh -o ... because unquoted variables are not split into words by default. Put the full ssh command inline, or use a shell function or an array (S=(ssh -o BatchMode=yes host); "${S[@]}"). This only bites when the shell is zsh, as on macOS, while bash splits the variable.