Created
November 7, 2024 23:01
-
-
Save dewomser/96abc89e76d4ff7592601eb0e34ab843 to your computer and use it in GitHub Desktop.
Bash 2 Dimensionales array
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
#!/bin/bash | |
declare -a a0=(1 2 3 4) | |
declare -a a1=(5 6 7 8) | |
declare -a a2=(100 110 120 130) | |
var="a1[1]" | |
echo ${!var} | |
# alternativ funktioniert nur mit ganzen Zahlen: echo $(( a1[1] )) | |
# Ergebnis ist 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment