4 changed files with 17 additions and 51 deletions
@ -1,42 +1,11 @@ |
|||
# Documentation |
|||
|
|||
* initiate |
|||
* [Bash Tips](./bash_tips.md) |
|||
* [Development Mode](./development.md) |
|||
* [TODO](./todo.md) |
|||
* [todo](./todo.md) |
|||
|
|||
## prevent last false |
|||
## initiate |
|||
|
|||
function body should not end up with a ternary statement |
|||
Rk: useful when timezone has changed or ghostty command has been installed aftwerwards |
|||
|
|||
### 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)) |
|||
``` |
|||
`miaou-bash --initiate` |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue