How to find the length of an array in shell?

$ a=(1 2 3 4)
$ echo ${#a[@]}
4

Leave a Comment