Mention that $(( expr )) is defined in POSIX.

Jari Aalto
2025-01-30 01:27:20 +02:00
parent 6d50546eb3
commit eba6aad24e

@@ -18,7 +18,7 @@ let a++
The `(( .. ))` arithmetic compound command evaluates expressions in the same way as `let`, except it's not subject to glob expansion and therefore requires no additional quoting or escaping. The `(( .. ))` arithmetic compound command evaluates expressions in the same way as `let`, except it's not subject to glob expansion and therefore requires no additional quoting or escaping.
This warning only triggers in Bash/Ksh scripts. In Sh/Dash, neither `let` nor `(( .. ))` are defined, but can be simulated with `[ $(( expr )) -ne 0 ]` to retain exit code, or `: $(( expr ))` to ignore it. This warning only triggers in Bash/Ksh scripts. In Sh/Dash, neither `let` nor `(( .. ))` are defined, but can be simulated with `[ $(( expr )) -ne 0 ]` to retain exit code, or `: $(( expr ))` to ignore it. For portability, the `$(( expr ))` syntax is defined in POSIX standard.
### Exceptions: ### Exceptions: