added : notes

This commit is contained in:
marinhoc 2018-06-15 21:48:27 +02:00
parent 679e787bd2
commit b95112b879
1 changed files with 2 additions and 0 deletions

View File

@ -1071,10 +1071,12 @@ f()for i in "$@"; do echo "$i"; done
```shell
# One line
# Note: The 3rd statement may run when the 1st is true
[[ "$var" == hello ]] && echo hi || echo bye
[[ "$var" == hello ]] && { echo hi; echo there; } || echo bye
# Multi line (no else, single statement)
# Note: The exit status may not be the same as with an if statement
[[ "$var" == hello ]] && \
echo hi