Foundations Updated 2026-09 View as Markdown

Basic Operators

Arithmetic Operators Simple arithmetics on variables can be done using the arithmetic expression: $((expression)) The basic operators are: a + b addition (a plus b) a - b substraction (a minus b) a b multiplication (a times b) a / b division (integer) (a divided by b) a % b modulo (the integer remainder of a divided by b) a b exponentiation (a to the power of b)

Arithmetic Operators

Simple arithmetics on variables can be done using the arithmetic expression: $((expression))

shell
A=3
B=$((100 * $A + 5)) # 305

The basic operators are:

a + b addition (a plus b)

a - b substraction (a minus b)

**a b* multiplication (a times b)

a / b division (integer) (a divided by b)

a % b modulo (the integer remainder of a divided by b)

a **** b** exponentiation (a to the power of b)

Exercise

Try it

run this one locally

Expected output

Total Cost is 128

Get the Bash agent pack

A battle-tested AGENTS.md, the review checklist, and the failure-mode cheat sheet for Bash. One email, then occasional updates when the tooling shifts. No course pitch.

Unsubscribe in one click. We never sell the list. Or just take the AGENTS.md now — no email needed.