Calcul Arithmétique

8 janvier 2021

Forme 1
jlc@HYSTOU:~$ a=10; b=5
jlc@HYSTOU:~$ c=$(expr $a – $b) ; echo $c
5
jlc@HYSTOU:~$

Forme 2
# Multiplying 9 by 8
let val1=9*3
echo $val1

# Dividing 8 by 3
let “val2 = 8 / 3”
echo $val2

# Subtracting 3 from 9
let val3=93
echo $val3

# Applying increment
let val4=7
let val4++
echo $val4

# Using argument value in arithmetic operation
let “val5=50+$1”
echo $val5