]> git.ipfire.org Git - thirdparty/bash.git/blame - tests/arith2.sub
Bash-5.2-rc4 release
[thirdparty/bash.git] / tests / arith2.sub
CommitLineData
8868edaf
CR
1# This program is free software: you can redistribute it and/or modify
2# it under the terms of the GNU General Public License as published by
3# the Free Software Foundation, either version 3 of the License, or
4# (at your option) any later version.
5#
6# This program is distributed in the hope that it will be useful,
7# but WITHOUT ANY WARRANTY; without even the implied warranty of
8# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9# GNU General Public License for more details.
10#
11# You should have received a copy of the GNU General Public License
12# along with this program. If not, see <http://www.gnu.org/licenses/>.
13#
b80f6443
JA
14echo $(( --7 ))
15echo $(( ++7 ))
16echo $(( -- 7 ))
17echo $(( ++ 7 ))
18
19((++array[0] ))
20echo $array
21(( ++ array[0] ))
22echo $array
23
24(( ++a ))
25echo $a
26(( ++ a ))
27echo $a
28
29(( --a ))
30echo $a
31(( -- a ))
32echo $a
33
34echo $(( 4 + ++a ))
35echo $a
36
37echo $(( 4+++a ))
38echo $a
39
40echo $(( 4---a ))
41echo $a
42
43echo $(( 4 - -- a ))
44echo $a
45
46(( -- ))
47echo $(( ---7 ))
48echo $(( -- - 7 ))
49
50(( ++ ))
51echo $(( ++7 ))
52echo $(( ++ + 7 ))
53
54echo $(( ++-7 ))
55echo $(( ++ - 7 ))
56
57echo $(( +--7 ))
58echo $(( -- + 7 ))