diff --git a/test.sh b/test.sh index fa9f618..83b025c 100755 --- a/test.sh +++ b/test.sh @@ -21,11 +21,15 @@ fi function myfunc() { local -n __resultvar="$1" || return 1 - __resultvar[*]="a" - __resultvar[*]="b" - __resultvar[*]="c" - __resultvar[*]="d" - __resultvar[*]="e" + __resultvar[0]="a" + __resultvar[1]="b" + echo 'yes'; + if [ -f /etc/debian_version ] ; then + __resultvar[2]="c" + __resultvar[3]="d" + __resultvar[4]="e" + fi + echo "ok" } # call function that constructs the array with the array name