From 8d676f01044f65fcc939c29711359b90c0d306c4 Mon Sep 17 00:00:00 2001 From: David Schroeder Date: Thu, 31 Jan 2019 23:09:06 -0600 Subject: [PATCH] Update test.sh --- test.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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