source: MondoRescue/branches/2.2.9/mindi-busybox/shell/ash_test/ash-arith/arith1.sub@ 3320

Last change on this file since 3320 was 3320, checked in by Bruno Cornec, 9 years ago
  • Re-add (thanks git BTW) the 2.2.9 branch which had been destroyed in the move to 3.0
  • Property svn:executable set to *
File size: 618 bytes
Line 
1# test of redone post-increment and post-decrement code
2( echo $(( 4-- )) )
3( echo $(( 4++ )) )
4( echo $(( 4 -- )) )
5( echo $(( 4 ++ )) )
6
7#ash# (( array[0]++ ))
8#ash# echo ${array}
9
10#ash# (( array[0] ++ ))
11#ash# echo ${array}
12
13#ash# (( a++ ))
14#ash# echo $a
15#ash# (( a ++ ))
16#ash# echo $a
17 a=2
18
19echo 6 $(( a ++ + 4 ))
20echo 3 $a
21
22echo 7 $(( a+++4 ))
23echo 4 $a
24
25echo 0 $(( a---4 ))
26echo 3 $a
27
28echo 7 $(( a -- + 4 ))
29echo 2 $a
30
31echo -2 $(( a -- - 4 ))
32echo 1 $a
33
34#ash# (( ++ + 7 ))
35
36#ash# (( ++ ))
37( echo $(( +++7 )) )
38# bash 3.2 apparently thinks that ++ +7 is 7
39#ash# echo $(( ++ + 7 ))
40#ash# (( -- ))
Note: See TracBrowser for help on using the repository browser.