summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authoralexandre medeiros <alexandre.medeiros@students.ic.unicamp.br>2013-09-22 01:06:35 -0300
committeralexandre medeiros <alexandre.medeiros@students.ic.unicamp.br>2013-09-22 01:20:31 -0300
commitc14586e8c3c285b34c20358fa97e44aeed356dde (patch)
tree6fc739b54ef4af4214fad04a792f89fb4ef03211
parent7aa69ae3d7e616e1664c5f11d264d827e7bc5fce (diff)
add conditional execution info to bash
-rw-r--r--bash.html.markdown5
1 files changed, 5 insertions, 0 deletions
diff --git a/bash.html.markdown b/bash.html.markdown
index 708131bd..41d0669e 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -4,6 +4,7 @@ tool: bash
contributors:
- ["Max Yankov", "https://github.com/golergka"]
- ["Darren Lin", "https://github.com/CogBear"]
+ - ["Alexandre Medeiros", "http://alemedeiros.sdf.org"]
filename: LearnBash.sh
---
@@ -51,6 +52,10 @@ else
echo "And this is not"
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:
echo $(( 10 + 5 ))