shell: handle $((NUM++...) like bash does. Closes 10706

function                                             old     new   delta
evaluate_string                                      680     729     +49

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2018-01-28 20:13:33 +01:00
parent 675d24aeaf
commit f19e3c1c6c
9 changed files with 57 additions and 14 deletions

View File

@@ -23,14 +23,14 @@
echo 5 $(( 4 + ++a ))
echo 1 $a
# ash doesn't handle it right...
#ash# echo 6 $(( 4+++a ))
#ash# echo 2 $a
# this is treated as 4 + ++a
echo 6 $(( 4+++a ))
echo 2 $a
a=2
# ash doesn't handle it right...
#ash# echo 3 $(( 4---a ))
#ash# echo 1 $a
# this is treated as 4 - --a
echo 3 $(( 4---a ))
echo 1 $a
a=1
echo 4 $(( 4 - -- a ))