mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Add more test
examples, including expression negation
Closes #4383
(cherry picked from commit ff66d2f3c1
)
This commit is contained in:
parent
d4ed2ca447
commit
04c69932e2
1 changed files with 16 additions and 0 deletions
|
@ -139,6 +139,22 @@ if test $status -eq 0
|
|||
end
|
||||
\endfish
|
||||
|
||||
The previous test can likewise be inverted:
|
||||
|
||||
\fish
|
||||
if test ! $status -eq 0
|
||||
echo "Previous command failed"
|
||||
end
|
||||
\endfish
|
||||
|
||||
which is logically equivalent to the following:
|
||||
|
||||
\fish
|
||||
if test $status -ne 0
|
||||
echo "Previous command failed"
|
||||
end
|
||||
\endfish
|
||||
|
||||
\subsection test-standards Standards
|
||||
|
||||
`test` implements a subset of the <a href="http://www.unix.com/man-page/POSIX/1/test/">IEEE Std 1003.1-2008 (POSIX.1) standard</a>. The following exceptions apply:
|
||||
|
|
Loading…
Reference in a new issue