Dear I need something to help me in this. I'm trying to modify a global array through a function , using an auxiliary variable called "array". I would like to modify the global array "config " using a function that takes a string with the name of the variable " config".
I'm trying the following but I have not gotten results .
declare -A config
function testABC {
array=${1}[@]
array["key"]="value1"
array["key2"]="value2"
}
testABC "config"
echo ${config["key"]}
echo ${config["key2"]}
#desired output:
#value1
#value2
My version of bash is 4.2.45
regards.