From d803ebbff9417f7b10305a18370a5e78cc410d65 Mon Sep 17 00:00:00 2001 From: Fabian Boehm Date: Sat, 26 Aug 2023 09:32:05 +0200 Subject: [PATCH] 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 --- doc_src/language.rst | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/doc_src/language.rst b/doc_src/language.rst index aa1442efa..a990b7553 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -429,12 +429,6 @@ This uses the :doc:`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 ` 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 `:: if test "$(uname)" = Linux @@ -549,7 +543,7 @@ Loops and blocks Like most programming language, fish also has the familiar :doc:`while ` and :doc:`for ` loops. -``while`` works like a repeated :doc:`if `:: +``while`` works like a repeated :ref:`if `:: while true echo Still running