shell: fix arithmentic evaluation of "++7" and such (it is + + 7, i.e. 7)

function                                             old     new   delta
evaluate_string                                      945     988     +43

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2021-09-25 22:04:45 +02:00
parent 627821e42b
commit d84a604830
9 changed files with 65 additions and 46 deletions

View File

@@ -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# (( -- ))