diff options
Diffstat (limited to 'shell/ash_test')
-rw-r--r-- | shell/ash_test/ash-arith/arith.right | 20 | ||||
-rwxr-xr-x | shell/ash_test/ash-arith/arith.tests | 10 | ||||
-rwxr-xr-x | shell/ash_test/ash-arith/arith1.sub | 4 | ||||
-rwxr-xr-x | shell/ash_test/ash-arith/arith2.sub | 10 |
4 files changed, 25 insertions, 19 deletions
diff --git a/shell/ash_test/ash-arith/arith.right b/shell/ash_test/ash-arith/arith.right index 6936f12..99ef825 100644 --- a/shell/ash_test/ash-arith/arith.right +++ b/shell/ash_test/ash-arith/arith.right @@ -97,6 +97,7 @@ ghi 3 3 4 4 4 4 +7 7 ./arith.tests: line 257: arithmetic syntax error ./arith.tests: line 259: arithmetic syntax error ./arith.tests: line 260: arithmetic syntax error @@ -105,6 +106,8 @@ ghi 4 4 7 7 -7 -7 +7 +7 ./arith1.sub: line 2: arithmetic syntax error ./arith1.sub: line 3: arithmetic syntax error ./arith1.sub: line 4: arithmetic syntax error @@ -119,11 +122,12 @@ ghi 2 2 -2 -2 1 1 -./arith1.sub: line 37: arithmetic syntax error -./arith2.sub: line 2: arithmetic syntax error -./arith2.sub: line 3: arithmetic syntax error -./arith2.sub: line 4: arithmetic syntax error -./arith2.sub: line 5: arithmetic syntax error +7 +7 +7 +7 +7 +7 5 5 1 1 6 6 @@ -132,8 +136,10 @@ ghi 1 1 4 4 0 0 -./arith2.sub: line 42: arithmetic syntax error -./arith2.sub: line 47: arithmetic syntax error +-7 +-7 +7 +7 8 12 ./arith.tests: line 290: arithmetic syntax error 42 diff --git a/shell/ash_test/ash-arith/arith.tests b/shell/ash_test/ash-arith/arith.tests index d65758e..746ccab 100755 --- a/shell/ash_test/ash-arith/arith.tests +++ b/shell/ash_test/ash-arith/arith.tests @@ -252,8 +252,8 @@ echo 3 $x echo 4 $(( ++x )) echo 4 $x -# bash 3.2 apparently thinks that ++7 is 7 -#ash# echo 7 $(( ++7 )) +# ++ is not a inc operator on non-variable, it is the + + sequence +echo 7 $(( ++7 )) ( echo $(( 7-- )) ) ( echo $(( --x=7 )) ) @@ -267,9 +267,9 @@ echo 4 $x echo 7 $(( +7 )) echo -7 $(( -7 )) -# bash 3.2 apparently thinks that ++7 is 7 -#ash# echo $(( ++7 )) -#ash# echo $(( --7 )) +# ++ is not a inc operator on non-variable, it is the + + sequence +echo $(( ++7 )) +echo $(( --7 )) ${THIS_SH} ./arith1.sub ${THIS_SH} ./arith2.sub diff --git a/shell/ash_test/ash-arith/arith1.sub b/shell/ash_test/ash-arith/arith1.sub index 80aa999..a36785c 100755 --- a/shell/ash_test/ash-arith/arith1.sub +++ b/shell/ash_test/ash-arith/arith1.sub @@ -35,6 +35,6 @@ echo 1 $a #ash# (( ++ )) ( echo $(( +++7 )) ) -# bash 3.2 apparently thinks that ++ +7 is 7 -#ash# echo $(( ++ + 7 )) +# ++ is not a inc operator on non-variable, it is the + + sequence +echo $(( ++ + 7 )) #ash# (( -- )) diff --git a/shell/ash_test/ash-arith/arith2.sub b/shell/ash_test/ash-arith/arith2.sub index 9105059..29f9471 100755 --- a/shell/ash_test/ash-arith/arith2.sub +++ b/shell/ash_test/ash-arith/arith2.sub @@ -1,4 +1,4 @@ -# bash 3.2 apparently thinks that ++7 is 7 etc +# ++ and -- are not inc/dec operators on non-variables, they are + + and - - sequences ( echo $(( --7 )) ) ( echo $(( ++7 )) ) ( echo $(( -- 7 )) ) @@ -37,13 +37,13 @@ echo 4 $(( 4 - -- a )) echo 0 $a #ash# (( -- )) -# bash 3.2 apparently thinks that ---7 is -7 -#ash# echo $(( ---7 )) +# -- is not a dec operator on non-variable, it is the - - sequence +echo $(( ---7 )) ( echo $(( -- - 7 )) ) #ash# (( ++ )) -# bash 3.2: 7 -#ash# echo 7 $(( ++7 )) +# ++ is not a inc operator on non-variable, it is the + + sequence +echo $(( ++7 )) ( echo $(( ++ + 7 )) ) # bash 3.2: -7 |