aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc_src
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2015-08-12 14:24:40 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2015-09-11 11:33:04 +0200
commit3810ef47f7d66f9b34fb0fa003579d86ed41d3ee (patch)
treebc709c4178db5ae58faf7aae6e160d50ab8691f2 /doc_src
parentbbbadbcb7881c11ec3f4f4790d7331cac9d16b65 (diff)
Add multi-condition example to if documentation
Diffstat (limited to 'doc_src')
-rw-r--r--doc_src/if.txt9
1 files changed, 9 insertions, 0 deletions
diff --git a/doc_src/if.txt b/doc_src/if.txt
index 0e9a7cb1..1cecdcd3 100644
--- a/doc_src/if.txt
+++ b/doc_src/if.txt
@@ -30,3 +30,12 @@ else
echo foo.txt and bar.txt do not exist
end
\endfish
+
+The following code will print "foo.txt exists and is readable" if foo.txt is a regular file and readable
+\fish
+if begin test -f foo.txt
+ and test -r foo.txt
+ end
+ echo "foo.txt exists and is readable"
+end
+\endfish