diff --git a/test.sh b/test.sh index a93f83f..91e7103 100755 --- a/test.sh +++ b/test.sh @@ -18,4 +18,17 @@ fi -linux_distro \ No newline at end of file +function myfunc() +{ + local __resultvar=$1 + local declare -A myresult + myresult[0]="a" + myresult[1]="b" + myresult[2]="c" + myresult[3]="d" + myresult[4]="e" + eval $__resultvar="'$myresult'" +} + +myfunc result +echo $result \ No newline at end of file