${(c)…}: Number of characters in array

${(c)#array} counts the characters in an array as if the elements were joined with a space.

Examples

Print characters of joined array
1
2
values=(a b c)
echo ${(c)#values}
Output:
1
5
BashSupport Pro 是一款支持 c** 的 **Zsh 集成开发环境 - 立即试用
© 2020–2024 Joachim Ansorg
声明
隐私政策
许可条款