Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Integer division |
** | Exponentiation |
% | Modulo (remainder) |
Example:
[me@linuxbox ~]$ echo $(( 5 / 2 ))
2
Notes, shell arithmetic only operates on integers.
Operator | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Integer division |
** | Exponentiation |
% | Modulo (remainder) |
Example:
[me@linuxbox ~]$ echo $(( 5 / 2 ))
2
Notes, shell arithmetic only operates on integers.