Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

1
  • Well, that's what I saw yesterday but I didn't keep my notes and I can't reproduce it so there was something wrong with my example. I've removed that portion of my answer. But the question is about ${#array[@]}, not ${#array[0]}. Even with your example, if ${#array} and ${#array[@]} were the same you would get 5 5 on line 4, not 3 5 since the expectation is both forms count the elements of the array. In zsh they are equivalent, in bash they are not. Commented Jun 28, 2013 at 5:11