Arithmetic Operators

Here is a sample shell script that will show you the differences between the operators. Make sure you give two arguments to the script.
#!/usr/bin/sh
print "$1 plus $2 is: $(( $1 + $2 ))"
print "$1 plus $2 is: (( $1 + $2 ))"
print "$1 minus $2 is: $(( $1 - $2 ))"
print "$1 minus $2 is: (( $1 - $2 ))"
print "$1 times $2 is: $(( $1 * $2 ))"
print "$1 times $2 is: (( $1 * $2 ))"
print "$1 div $2 is: $(( $1 / $2 ))"
print "$1 div $2 is: (( $1 / $2 ))"
print "$1 modulus $2 is: $(( $1 % $2 ))"
print "$1 modulus $2 is: (( $1 % $2 ))"
When you try 7 and 5 as the numbers here are the results. Notice what happenas if you forget the leading $ in front of the brackets:
$ sh adder.sh 7 5
7 plus 5 is: 12
7 plus 5 is: (( 7 + 5 ))
7 minus 5 is: 2
7 minus 5 is: (( 7 - 5 ))
7 times 5 is: 35
7 times 5 is: (( 7 * 5 ))
7 div 5 is: 1
7 div 5 is: (( 7 / 5 ))
7 modulus 5 is: 2
7 modulus 5 is: (( 7 % 5 ))
$