diff --git a/doc_src/language.rst b/doc_src/language.rst index b84280e36..6070d42e5 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -360,6 +360,12 @@ The other conditionals use the :ref:`exit status ` of a comman Unlike programming languages you might know, :ref:`if ` doesn't take a *condition*, it takes a *command*. If that command returned a successful :ref:`exit status ` (that's 0), the ``if`` branch is taken, otherwise the :ref:`else ` branch. +To check a condition, there is the :ref:`test ` command:: + + if test 5 -gt 2 + echo Yes, five is greater than two + end + Some examples:: # Just see if the file contains the string "fish" anywhere.