Use the value of the enclosed arithmetic expression.
The Korn shell uses arithmetic operators from the C programming language; they are listed below in decreasing order of precedence:
Logical negation; binary inversion (one's complement).
* / %
Multiplication; division; modulus (remainder).
Bitwise left shift; bitwise right shift.
Less than or equal to; greater than or equal to.
Less than; greater than.
Equality; inequality (both evaluated left to right).
Bitwise exclusive OR.
*= /= %=
= += -=
&= ^= |=
See the let command for more information and examples.
let "count=0" "i = i + 1" Assign
count. let "num % 2" Test for an even number. (( percent >= 0 && percent <= 100 )) Test the range of a value.