Adds note, and solution, for error code when incrementing from 0 to 1

S0AndS0
2020-11-02 01:20:13 +00:00
parent 84bed2ac07
commit d687b2d023

@@ -9,8 +9,11 @@ let a++
### Correct code:
```sh
(( a++ ))
(( a++ )) || true
```
> Note, `|| true` bits ignore error status code when incrementing from `0` to `1`
### Rationale:
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.