mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
docs: Some teensy bits on if/while
The ``test`` thing was just duplicated, and ``while`` linked to the if-*command* page, where the syntax section is probably nicer
This commit is contained in:
parent
03e659f96d
commit
d803ebbff9
1 changed files with 1 additions and 7 deletions
|
@ -429,12 +429,6 @@ This uses the :doc:`test <cmds/test>` command to see if the file /etc/os-release
|
|||
|
||||
Unlike other shells, the condition command just ends after the first job, there is no ``then`` here. Combiners like ``and`` and ``or`` extend the condition.
|
||||
|
||||
``if`` is commonly used with the :doc:`test <cmds/test>` command that can check conditions.::
|
||||
|
||||
if test 5 -gt 2
|
||||
echo "Yes, 5 is greater than 2"
|
||||
end
|
||||
|
||||
A more complicated example with a :ref:`command substitution <expand-command-substitution>`::
|
||||
|
||||
if test "$(uname)" = Linux
|
||||
|
@ -549,7 +543,7 @@ Loops and blocks
|
|||
|
||||
Like most programming language, fish also has the familiar :doc:`while <cmds/while>` and :doc:`for <cmds/for>` loops.
|
||||
|
||||
``while`` works like a repeated :doc:`if <cmds/if>`::
|
||||
``while`` works like a repeated :ref:`if <syntax-if>`::
|
||||
|
||||
while true
|
||||
echo Still running
|
||||
|
|
Loading…
Reference in a new issue