-
Notifications
You must be signed in to change notification settings - Fork 1.8k
SC2219
S0AndS0 edited this page Nov 2, 2020
·
2 revisions
let a++
(( a++ )) || true
Note,
|| true
bits ignore error status code when incrementing from0
to1
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.
None.
- Bash Hacker's Wiki: The let builtin command