How to find the length of an array in shell?


Question

How to find the array length in unix shell?

1
57
7/25/2018 9:29:17 PM

$$ a=(1 2 3 4)
$$ echo ${#a[@]}
4
70
12/11/2009 7:51:32 AM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon