aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src/if.txt
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-09-01 02:14:13 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-09-01 02:14:13 -0700
commitde5223db66ba36001020f7b3c2acda4303b927b3 (patch)
tree5f8b5cdf5d8975927e602337065e96fccf12af51 /doc_src/if.txt
parentcc1395797e78a26583461333199181b4f8ec0b13 (diff)
Improve documentation and error reporting for elseif.
Diffstat (limited to 'doc_src/if.txt')
-rw-r--r--doc_src/if.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc_src/if.txt b/doc_src/if.txt
index afad5384..aa43bdfb 100644
--- a/doc_src/if.txt
+++ b/doc_src/if.txt
@@ -1,7 +1,7 @@
\section if if - conditionally execute a command
\subsection if-synopsis Synopsis
-<tt>if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end</tt>
+<tt>if CONDITION; COMMANDS_TRUE...; [elseif CONDITION2; COMMANDS_TRUE2...;] [else; COMMANDS_FALSE...;] end</tt>
\subsection if-description Description
@@ -24,10 +24,13 @@ variable.
<pre>
if test -f foo.txt
echo foo.txt exists
+elseif test -f bar.txt
+ echo bar.txt exists
else
- echo foo.txt does not exist
+ echo foo.txt and bar.txt do not exist
end
-</pre>
-will print <tt>foo.txt exists</tt> if the file foo.txt
+</pre>will print <tt>foo.txt exists</tt> if the file foo.txt
exists and is a regular file, otherwise it will print
-<tt>foo.txt does not exist</tt>.
+<tt>bar.txt exists</tt> if the file bar.txt exists
+and is a regular file, otherwise it will print
+<tt>foo.txt and bar.txt do not exist</tt>.