From eba6aad24e527e9199bcf405b4e2badb79ed2b40 Mon Sep 17 00:00:00 2001 From: Jari Aalto Date: Thu, 30 Jan 2025 01:27:20 +0200 Subject: [PATCH] Mention that `$(( expr ))` is defined in POSIX. --- SC2219.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SC2219.md b/SC2219.md index e3b14de..4b4c768 100644 --- a/SC2219.md +++ b/SC2219.md @@ -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. -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: