From 1287b9d82382bf22e16edda67eae755f07397f2e Mon Sep 17 00:00:00 2001 From: "David Adam (zanchey)" Date: Sun, 12 May 2013 15:56:01 +0800 Subject: Help cleanup Large list of changes, including formatting and typos for most commands. More substantive changes have been made to alias, bind, block, break, builtin, case, cd, commandline, count, else, emit, fish_config, funced, function, functions, history, math, mimedb, nextd, not, popd, prevd, pushd, pwd, random, read, set, set_color, switch, test, trap, type, ulimit, umask, and while. --- doc_src/else.txt | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'doc_src/else.txt') diff --git a/doc_src/else.txt b/doc_src/else.txt index e0f8b85b..66d8be3f 100644 --- a/doc_src/else.txt +++ b/doc_src/else.txt @@ -4,14 +4,18 @@ if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end \subsection else-description Description -if will execute the command CONDITION. If the condition's exit -status is 0, the commands COMMANDS_TRUE will execute. If it is not 0 and -else is given, COMMANDS_FALSE will be executed. Hint: use -begin; ...; end for complex conditions. +if will execute the command \c CONDITION. If the condition's exit +status is 0, the commands \c COMMANDS_TRUE will execute. If it is not 0 and +else is given, \c COMMANDS_FALSE will be executed. \subsection else-example Example -The command if test -f foo.txt; echo foo.txt exists; else; echo foo.txt does not exist; end -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. +The following code tests whether a file \c foo.txt exists as a regular file. + +
+if test -f foo.txt
+    echo foo.txt exists
+else
+    echo foo.txt does not exist
+end
+
-- cgit v1.2.3