diff options
author | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:33:51 -0600 |
---|---|---|
committer | Pete Travis <immanetize@fedoraproject.org> | 2014-10-01 11:33:51 -0600 |
commit | 3f6c1435a4cbdf73a65639b05898a01c0dfc21ac (patch) | |
tree | c29f3db44b106fc8b145656cd0238341551b22c0 /scratch/bash-3.1.orig/tests/appendop.tests | |
parent | 46c50fce0354d81d347a8055314a688fc8aa9f52 (diff) | |
download | rpmbuild-3f6c1435a4cbdf73a65639b05898a01c0dfc21ac.tar.gz rpmbuild-3f6c1435a4cbdf73a65639b05898a01c0dfc21ac.tar.xz rpmbuild-3f6c1435a4cbdf73a65639b05898a01c0dfc21ac.zip |
we might need this sles10 stuff latersles10-bash
Diffstat (limited to 'scratch/bash-3.1.orig/tests/appendop.tests')
-rw-r--r-- | scratch/bash-3.1.orig/tests/appendop.tests | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/scratch/bash-3.1.orig/tests/appendop.tests b/scratch/bash-3.1.orig/tests/appendop.tests new file mode 100644 index 0000000..7b61f3f --- /dev/null +++ b/scratch/bash-3.1.orig/tests/appendop.tests @@ -0,0 +1,83 @@ +# basic cases +a=1 +a+=4 +echo $a + +x=(1 2 3) +x+=(4 5 6) + +echo ${x[@]} + +x[4]+=1 +echo ${x[@]} + +# trickier cases + +a+=5 printenv a +echo $a + +# if the integer flag is set, ksh93 appears to do arithmetic += and evaluate +# old value as an arithmetic expression +a= +typeset -i a +a+=7 +echo $a + +b=4+1 +typeset -i b +b+=37 + +echo $b + +unset x +x=(1 2 3 4 5) + +typeset -i x + +x[4]+=7 + +echo ${x[@]} + +unset x +typeset -i x + +x=([0]=7+11) +echo ${x[@]} + +unset x +x=(1 2 3 4 5) + +typeset -i x + +#x[4]=7+11 + +x=(1 2 3 4 [4]=7+11 ) +echo ${x[@]} + +x=( 1 2 [2]+=7 4 5 ) +echo ${x[@]} + +x+=( [3]+=9 [5]=9 ) +echo ${x[@]} + +unset a +a=1 +export a+=4 +printenv a +printenv a+ + +unset x +typeset -i x=4+5 +echo $x + +unset x +typeset x+=4 +echo $x + +typeset -i x+=5 +echo $x + +readonly x+=7 +echo $x + +x+=5 |