${(@)…}
: Array elements as separate words
In double quotes, array elements are put into separate words.
Links
Examples
- Expand array values into separate words
- Output:
1 2 3 4 5
value=(one two three) # with the flag, each value is expanded into a word for f in "${(@)value}"; do echo "with flag: $f"; done # without the flag, it's expanded into just one word for f in "${value}"; do echo "without flag: $f"; done
1 2 3 4
with flag: one with flag: two with flag: three without flag: one two three
BashSupport Pro 是一款支持 @** 的 **Zsh 集成开发环境 - 立即试用!