summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAvjinder <avisekhon@gmail.com>2013-08-31 17:05:04 +0530
committerAvjinder <avisekhon@gmail.com>2013-08-31 17:05:04 +0530
commite2cd18ba463279a650c2393f68f37131a52b4c4d (patch)
tree2ce3bbe6feb640c3d9c64cfd02dcf1db8dcb2b54
parent4dd948ccd297290414eecc6038277e97750c5f5e (diff)
Update bash.html.markdown
In the case statement, the "in" keyword should be on the same line as case $VARIABLE. Also, ;; should be present at the end of each command. Shell executes all statements up to the two semicolons that are next to each other.
-rw-r--r--bash.html.markdown9
1 files changed, 4 insertions, 5 deletions
diff --git a/bash.html.markdown b/bash.html.markdown
index a0c43c12..76c794c6 100644
--- a/bash.html.markdown
+++ b/bash.html.markdown
@@ -73,12 +73,11 @@ ls -l | grep "\.txt"
echo "There are $(ls | wc -l) items here."
# Bash uses a case statement that works similarily to switch in Java and C++:
-case "$VARIABLE"
-in
+case "$VARIABLE" in
#List patterns for the conditions you want to meet
- 0) echo "There is a zero."
- 1) echo "There is a one."
- *) echo "It is not null."
+ 0) echo "There is a zero.";;
+ 1) echo "There is a one.";;
+ *) echo "It is not null.";;
esac
#For loops iterate for as many arguments given: