This commit is contained in:
2019-01-31 23:27:58 -06:00
parent 5ce9eb5032
commit f08c574c71
2 changed files with 21 additions and 83 deletions

20
test.sh
View File

@@ -18,22 +18,4 @@ fi
function myfunc()
{
local -n myresult="$1" || return 1
myresult[0]="a"
myresult[1]="b"
myresult[2]="c"
myresult[3]="d"
myresult[4]="e"
}
generatearray() {
# $1 is array name in which array is generated
local -n array="$1" || return 1
array=( foo doo coo )
}
# call function that constructs the array with the array name
myfunc targetvalue
# display it
declare -p myresult
detect_os