diff options
author | David Adam (zanchey) <zanchey@ucc.gu.uwa.edu.au> | 2013-05-12 15:56:01 +0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2013-05-13 01:48:20 -0700 |
commit | 1287b9d82382bf22e16edda67eae755f07397f2e (patch) | |
tree | 811814b029d65ac11a193e616ca4a71d216dbe0c /doc_src/else.txt | |
parent | 91aab03b90a6b583a3c0ecff5b015c6066d34f28 (diff) |
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.
Diffstat (limited to 'doc_src/else.txt')
-rw-r--r-- | doc_src/else.txt | 20 |
1 files changed, 12 insertions, 8 deletions
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 @@ <tt>if CONDITION; COMMANDS_TRUE...; [else; COMMANDS_FALSE...;] end</tt> \subsection else-description Description -<tt>if</tt> 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 -<tt>else</tt> is given, COMMANDS_FALSE will be executed. Hint: use -<a href="#begin"><tt>begin; ...; end</tt></a> for complex conditions. +<tt>if</tt> 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 +<tt>else</tt> is given, \c COMMANDS_FALSE will be executed. \subsection else-example Example -The command <tt>if test -f foo.txt; echo foo.txt exists; else; echo foo.txt does not exist; end</tt> -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>. +The following code tests whether a file \c foo.txt exists as a regular file. + +<pre> +if test -f foo.txt + echo foo.txt exists +else + echo foo.txt does not exist +end +</pre> |