Merge branch 'master' of github.com:dylanaraps/pure-bash
This commit is contained in:
@@ -1088,10 +1088,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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user