I am trying to create a structure that will allow me to group data inside an array in bashHere is what I have tried:indexes=()first_element=( value='one' another_value='two' yet_another_value='three')indexes+=('first_element')second_element=( value='four' another_value='five' yet_another_value='six')indexes+=('second_element')for i in ${indexes[@]}do    # Here the i variable contains the name of the array I am supposed to loop through    # but I cannot fugure out how to access that array using the stored string...    for j in ${j[@]}    do        #Here I am supposed to get the actually array        echo $j    donedoneOf course it doesn't work... Am I doing something wrong, or is it impossible to access variables that way?
Attempt to fake a 2D multidimentional array in bash by storing the array name as string
bash;array
This has already been answer on SO : How to declare 2D array in bashwhen using bash keep in mind it's script and not compile langage like C or java, variable by reference or pointer are not used or at least not the same wayThe SO answer suggests:#!/bin/bashdeclare -A matrixnum_rows=4num_columns=5for ((i=1;i<=num_rows;i++)) do    for ((j=1;j<=num_columns;j++)) do        matrix[$i,$j]=$RANDOM    donedonef1=%$((${#num_rows}+1))sf2= %9sprintf $f1 ''for ((i=1;i<=num_rows;i++)) do    printf $f2 $idoneechofor ((j=1;j<=num_columns;j++)) do    printf $f1 $j    for ((i=1;i<=num_rows;i++)) do        printf $f2 ${matrix[$i,$j]}    done    echodonethe above example creates a 4x5 matrix with random numbers and print it transposed, with the example result          1         2         3         4 1     18006     31193     16110     23297 2     26229     19869      1140     19837 3      8192      2181     25512      2318 4      3269     25516     18701      7977 5     31775     17358      4468     30345The principle is: Creating one associative array where the index is an string like 3,4. The benefits:it's possible to use for any-dimension arrays ;) like: 30,40,2 for 3 dimensional.the syntax is close to C like arrays ${matrix[2,3]}