blob: 0e6a42c13b2c535c7a344568bde8c9a52f08ac67 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
f() { declare -p ${!var*} | grep ^var; declare -p var ; }
var[0]=X var[@]=Y f
unset -f f
unset -v var
typeset -A var
f() { declare -p ${!var*}; }
var[0]=X var[@]=Y
f
: ${THIS_SH:=./bash}
env 'v[0]=help' ${THIS_SH} -c 'printenv "v[0]"'
unset -v var
f() { test -v 'var[0]'; echo $?; }
var[0]=X f
unset -v var
|