Last active
September 8, 2015 15:00
-
-
Save perguth/4539a62b3d4d23dec15a to your computer and use it in GitHub Desktop.
Iterate over an array in Bash.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ARRAY=( | |
| hello | |
| world | |
| ) | |
| i=0 | |
| while [ $i -lt ${#ARRAY[@]} ]; do | |
| echo ${ARRAY[i]} | |
| ((i++)) | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment