]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/array16.sub
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / array16.sub
CommitLineData
ac50fbac
CR
1foo[0]=a
2foo[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
9typeset -i foo
10
11[[ -v foo[1] ]] && echo foo: arithmetic evaluation: ok
12
13typeset -a bar
14bar[1]=set
15
16[[ -v bar ]] || echo bar: array with element zero unset: ok
17[[ -v bar[0] ]] || echo bar: element zero: ok
18
19typeset -a qux
20[[ -v qux ]] || echo qux: unset array: ok
21[[ -v qux[0] ]] || echo qux: unset array element 0: ok