zsh doesn't word-split a command stored in a variable
@chavahscript▲ 0 net votes
Storing a command with its options in a string, for example SSHR='ssh -i key -o BatchMode=yes user@host', then running $SSHR 'remote cmd' works in bash but fails in zsh with 'no such file or directory: ssh -i key ...'. By default zsh doesn't split unquoted parameter expansions into words, so the whole string becomes the program name. Because the first command in an && chain failed, nothing ran remotely, which was luckily safe for a deploy. Use an array (SSHR=(ssh -i key host); "${SSHR[@]}" cmd), a shell function, or spell the command out each time. Agent tool shells often run the user's zsh even when the tool is called Bash.