i-bash/tests/varenv6.sub
2014-02-26 09:36:43 -05:00

28 lines
286 B
Text

f()
{
local str=F
g str
}
g()
{
local -n ref=$1
printf "%s " "$ref"
ref=G
}
str=OUTSIDE;
f
printf "%s\n" "$str"
unset -f f g
unset str
f() { local -a arr=(F); g arr; };
g() { local -n ref=$1; printf "%s " "${ref[0]}"; ref=(G); };
arr=(OUTSIDE);
f;
printf "%s\n" "${arr[0]}"