Skip to content

Instantly share code, notes, and snippets.

@dewomser
Created November 7, 2024 23:01
Show Gist options
  • Save dewomser/96abc89e76d4ff7592601eb0e34ab843 to your computer and use it in GitHub Desktop.
Save dewomser/96abc89e76d4ff7592601eb0e34ab843 to your computer and use it in GitHub Desktop.
Bash 2 Dimensionales array
#!/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