pvincent 2 weeks ago
parent
commit
af055bcaa6
  1. 38
      doc/index.md

38
doc/index.md

@ -0,0 +1,38 @@
# Documentation
## prevent last false
function body should not end up with a ternary statement
### wrong last
Compound of 2 'false' statement returns false.
```bash
[[ : ]] && [[ : ]]
```
### right last
```bash
[[ : ]] && [[ : ]] || true
```
## arithmetic issue
last (++) statement does not complete successfully!
### wrong ++
```bash
count=0
(( ++count )) # ok
(( ++count )) # last statement in function returns false
```
### right ++
```bash
count=0
count=$((count+1))
```
Loading…
Cancel
Save