Bash handles basic arithmetic operations, including:
- Addition:
a + b - Subtraction:
a - b - Multiplication:
a * b - Division:
a / b - Modulus:
a % b
You can perform these operations using the $(( )) syntax. For example:
result=$((a + b))
This will calculate the sum of a and b and store it in result.
