## ~emersion/mrsh

ref: 537899b8a63adf88d442790b4cf6a38edd9288d9 mrsh/test/arithm.sh -rw-r--r-- 692 bytes
537899b8Simon Ser shell/arithm: strip mrsh_ prefix for static functions 2 years ago
`                                                                                `
```1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30```
```#!/bin/sh -eu

echo "1 =" \$((1))
echo "2*5 =" \$((2*5))
echo "2/5 =" \$((2/5))
echo "2%5 =" \$((2%5))
echo "2+5 =" \$((2+5))
echo "2-5 =" \$((2-5))
echo "2<<5 =" \$((2<<5))
echo "2>>5 =" \$((2>>5))
echo "2<5 =" \$((2<5))
# https://github.com/emersion/mrsh/issues/86
#echo "2<=5 =" \$((2<=5))
echo "2>5 =" \$((2>5))
#echo "2>=5 =" \$((2>=5))
echo "2==5 =" \$((2==5))
echo "2!=5 =" \$((2!=5))
echo "2&5 =" \$((2&5))
echo "2^5 =" \$((2^5))
echo "2|5 =" \$((2|5))
#echo "2&&5 =" \$((2&&5))
#echo "2||5 =" \$((2||5))

# Associativity
# https://github.com/emersion/mrsh/issues/53
echo "1+2+3 =" \$((1+2+3))
#echo "5-1-2 =" \$((5-1-2))
echo "1+2*3 =" \$((1+2*3))
echo "2*3+1 =" \$((2*3+1))
#echo "2*(3+1) =" \$((2*(3+1)))
```