]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/appendop.tests
Imported from ../bash-3.1.tar.gz.
[thirdparty/bash.git] / tests / appendop.tests
CommitLineData
95732b49
JA
1# basic cases
2a=1
3a+=4
4echo $a
5
6x=(1 2 3)
7x+=(4 5 6)
8
9echo ${x[@]}
10
11x[4]+=1
12echo ${x[@]}
13
14# trickier cases
15
16a+=5 printenv a
17echo $a
18
19# if the integer flag is set, ksh93 appears to do arithmetic += and evaluate
20# old value as an arithmetic expression
21a=
22typeset -i a
23a+=7
24echo $a
25
26b=4+1
27typeset -i b
28b+=37
29
30echo $b
31
32unset x
33x=(1 2 3 4 5)
34
35typeset -i x
36
37x[4]+=7
38
39echo ${x[@]}
40
41unset x
42typeset -i x
43
44x=([0]=7+11)
45echo ${x[@]}
46
47unset x
48x=(1 2 3 4 5)
49
50typeset -i x
51
52#x[4]=7+11
53
54x=(1 2 3 4 [4]=7+11 )
55echo ${x[@]}
56
57x=( 1 2 [2]+=7 4 5 )
58echo ${x[@]}
59
60x+=( [3]+=9 [5]=9 )
61echo ${x[@]}
62
63unset a
64a=1
65export a+=4
66printenv a
67printenv a+
68
69unset x
70typeset -i x=4+5
71echo $x
72
73unset x
74typeset x+=4
75echo $x
76
77typeset -i x+=5
78echo $x
79
80readonly x+=7
81echo $x
82
83x+=5