正如在另一篇关于数组的文章中看到的,我尝试了以下方法:
test[1]="hello" test[7]="foo" test[3]="world" echo ${#test[@]} 7
但它给了我关联数组的最后一个索引。
如何获取关联数组的长度?
zsh
zsh ×1