mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2024-12-23 17:41:41 +00:00
add conditional execution info to bash
This commit is contained in:
parent
7aa69ae3d7
commit
c14586e8c3
@ -4,6 +4,7 @@ tool: bash
|
|||||||
contributors:
|
contributors:
|
||||||
- ["Max Yankov", "https://github.com/golergka"]
|
- ["Max Yankov", "https://github.com/golergka"]
|
||||||
- ["Darren Lin", "https://github.com/CogBear"]
|
- ["Darren Lin", "https://github.com/CogBear"]
|
||||||
|
- ["Alexandre Medeiros", "http://alemedeiros.sdf.org"]
|
||||||
filename: LearnBash.sh
|
filename: LearnBash.sh
|
||||||
---
|
---
|
||||||
|
|
||||||
@ -51,6 +52,10 @@ else
|
|||||||
echo "And this is not"
|
echo "And this is not"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# There is also conditional execution
|
||||||
|
echo "Always executed" || echo "Only executed if first command fail"
|
||||||
|
echo "Always executed" && echo "Only executed if first command does NOT fail"
|
||||||
|
|
||||||
# Expressions are denoted with the following format:
|
# Expressions are denoted with the following format:
|
||||||
echo $(( 10 + 5 ))
|
echo $(( 10 + 5 ))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user