Bash-4.3 distribution sources and documentation
[platform/upstream/bash.git] / tests / array16.sub
1 foo[0]=a
2 foo[1]=b
3
4 [[ -v foo[1] ]] && echo foo index 1: ok
5 [[ -v foo[2] ]] || echo foo index 2: ok
6
7 [[ -v foo ]] && echo foo: implicit reference to element 0: ok
8
9 typeset -i foo
10
11 [[ -v foo[1] ]] && echo foo: arithmetic evaluation: ok
12
13 typeset -a bar
14 bar[1]=set
15
16 [[ -v bar ]] || echo bar: array with element zero unset: ok
17 [[ -v bar[0] ]] || echo bar: element zero: ok
18
19 typeset -a qux
20 [[ -v qux ]] || echo qux: unset array: ok
21 [[ -v qux[0] ]] || echo qux: unset array element 0: ok