]> git.ipfire.org Git - thirdparty/bash.git/blob - tests/array14.sub
Bash-4.3 patch 7
[thirdparty/bash.git] / tests / array14.sub
1 # start at a test suite for negative indexed array subscripts -- post bash-4.2
2 x=( 0 1 2 3 4 5)
3 declare -p x
4
5 unset 'x[-1]'
6 declare -p x
7
8 unset 'x[-2]'
9 declare -p x
10
11 unset 'x[-10]'
12
13 x[-2]=3
14 declare -p x
15
16 x+=( five )
17 declare -p x
18 x[-1]=5
19 declare -p x
20
21 x+=( [-1]=foo )
22 declare -p x
23
24 x[-1]=5
25 declare -p x
26
27 x[-2]+=four
28 declare -p x
29
30 echo "strlen(${x[-2]})" = ${#x[-2]}