From de5223db66ba36001020f7b3c2acda4303b927b3 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sat, 1 Sep 2012 02:14:13 -0700 Subject: Improve documentation and error reporting for elseif. --- doc_src/if.txt | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'doc_src/if.txt') 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 -if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end +if CONDITION; COMMANDS_TRUE...; [elseif CONDITION2; COMMANDS_TRUE2...;] [else; COMMANDS_FALSE...;] end \subsection if-description Description @@ -24,10 +24,13 @@ variable.
 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
-
-will print foo.txt exists if the file foo.txt +will print foo.txt exists if the file foo.txt exists and is a regular file, otherwise it will print -foo.txt does not exist. +bar.txt exists if the file bar.txt exists +and is a regular file, otherwise it will print +foo.txt and bar.txt do not exist. -- cgit v1.2.3