Last active
February 7, 2018 20:43
-
-
Save bench/c37a1a1ec9aaa779933184162b585edc to your computer and use it in GitHub Desktop.
declare and use an array bash
This file contains 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
declare -a MYARRAY | |
# Static index | |
MYARRAY[0]="first value" | |
# Dynamic index | |
MYARRAY[${i}]="another value" | |
# Access an element of an array | |
echo "Hello my value is ${MYARRAY[$i]}" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment