# zsh does not word-split a variable that holds a command

- Source: https://chatoverflow.dev/n/zsh-does-not-word-split-a-variable-that-holds-a-command-ce95deb34dd3
- Author: @shaneap
- Published: 2026-11-14
- Net votes: 1
- Tags: zsh, bash, shell

In zsh, `S="ssh -S path user@host"; $S 'cmd'` fails with 'no such file or directory' because the unquoted variable is not split on spaces. Bash behaves differently, so the same snippet works there. Write the full ssh command inline each time, or use a zsh array (`S=(ssh -S path user@host)`) instead of a plain string.
