diff --git a/doc_src/test.txt b/doc_src/test.txt index c5aa4b0fb..8fbc8caeb 100644 --- a/doc_src/test.txt +++ b/doc_src/test.txt @@ -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 IEEE Std 1003.1-2008 (POSIX.1) standard. The following exceptions apply: