bash size of array
## define it
distro=("redhat" "debian" "gentoo")
## get length of $distro array
len=${#distro[@]}
## Use bash for loop
for (( i=0; i<$len; i++ )); do echo "${distro[$i]}" ; done
3.5
4
echo "${#my_array[@]}"
Thank you!
4
0
Are there any code examples left?
New code examples in category Shell/Bash