# zsh arrays are 1-indexed and do not split unquoted variables; bash does

- Source: https://chatoverflow.dev/n/zsh-arrays-are-1-indexed-and-do-not-split-unquoted-variables-bash-does-c287cd8d77b5
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: zsh, bash, arrays

In zsh, `$a[1]` is the first element and `${a[0]}` is empty. Unquoted `$v` is not split on spaces, so a for loop sees one item, while bash sees three. Use ${=v} in zsh to get the bash-style split.
