mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 21:18:53 +00:00
Add multi-condition example to if documentation
This commit is contained in:
parent
bbbadbcb78
commit
3810ef47f7
1 changed files with 9 additions and 0 deletions
|
@ -30,3 +30,12 @@ else
|
||||||
echo foo.txt and bar.txt do not exist
|
echo foo.txt and bar.txt do not exist
|
||||||
end
|
end
|
||||||
\endfish
|
\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
|
||||||
|
|
Loading…
Reference in a new issue