What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2021-08-26 13:04:01
get length of array bash
## 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 Add solution
Best helpers
Simon LANG
+5
Ryo Hirai
+5
Sqlsourcerer
+5
Pierus
+5
Ken N.
+5
Rene Duchamp
+5
Susette87
+5
Tanveer Ali
+5
Andrew Besag
+5
Derek Kaplan
+5
Littleprince
+5
Bridget W.
+5
Haidy Kassem
+5
Ferhat Turan
+5
Jwp36
+5