5.4. Arithmetic ExpressionsThe let command performs integer arithmetic. bash provides a way to substitute integer values (for use as command arguments or in variables ); base conversion is also possible. Table 5-30. Syntax for arithmetic expressions
5.4.1. Operatorsbash uses arithmetic operators from the C programming language; the following list is in decreasing order of precedence. Use parentheses to override precedence. Table 5-31. Arithmetic operators
5.4.2. ExamplesSee the let built-in command for more information and examples. let "count=0" "i = i + 1" Assign i and count let "num % 2"; echo $? Test for an even number |