diff --git a/doc_src/tutorial.hdr b/doc_src/tutorial.hdr index bc4df3bd7..54f0ce1ae 100644 --- a/doc_src/tutorial.hdr +++ b/doc_src/tutorial.hdr @@ -19,6 +19,7 @@ - Shell Variables - Lists - Command Substitutions +- Separating Commands (Semicolon) - Combiners (And, Or, Not) - Conditionals (If, Else, Switch) - Functions @@ -403,6 +404,20 @@ Unlike other shells, fish does not split command substitutions on any whitespace \endfish +\section tut_semicolon Separating Commands (Semicolon) +Like other shells, fish allows multiple commands either on separate lines or the same line. + +To write them on the same line, use the semicolon (";"). That means the following two examples are equivalent: + +\fish +echo fish; echo chips + +# or +echo fish +echo chips +\endfish + + \section tut_combiners Combiners (And, Or, Not) Unlike other shells, `fish` does not have special syntax like && or || to combine commands. Instead it has commands `and`, `or`, and `not`. @@ -412,6 +427,14 @@ Unlike other shells, `fish` does not have special syntax like && or || t Backup failed \endfish +As mentioned in the section on the semicolon, this can also be written in multiple lines, like so: + +\fish +cp file1.txt file1_bak.txt +and echo "Backup successful" +or echo "Backup failed" +\endfish + \section tut_conditionals Conditionals (If, Else, Switch)