mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-07 10:01:14 -03:00
Add multi-condition example to if documentation
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user