mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-14 14:03:58 +00:00
docs/tutorial: Put exit status with combiners and conditionals
It was awkwardly sandwhiched inbetween variables and exports. [ci skip]
This commit is contained in:
parent
53216940c4
commit
d338f74e6d
1 changed files with 17 additions and 17 deletions
|
@ -232,23 +232,6 @@ Unlike other shells, variables are not further split after substitution::
|
|||
In bash, this would have created two directories "Mister" and "Noodle". In ``fish``, it created only one: the variable had the value "Mister Noodle", so that is the argument that was passed to ``mkdir``, spaces and all. Other shells use the term "arrays", rather than lists.
|
||||
|
||||
|
||||
Exit Status
|
||||
-----------
|
||||
|
||||
Unlike other shells, ``fish`` stores the exit status of the last command in ``$status`` instead of ``$?``.
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
>_ false
|
||||
>_ echo $status
|
||||
1
|
||||
|
||||
|
||||
Zero is considered success, and non-zero is failure. There is also a ``$pipestatus`` list variable for the exit statues of processes in a pipe.
|
||||
|
||||
|
||||
Exports (Shell Variables)
|
||||
-------------------------
|
||||
|
||||
|
@ -405,6 +388,23 @@ To write them on the same line, use the semicolon (";"). That means the followin
|
|||
|
||||
|
||||
|
||||
Exit Status
|
||||
-----------
|
||||
|
||||
Unlike other shells, ``fish`` stores the exit status of the last command in ``$status`` instead of ``$?``.
|
||||
|
||||
|
||||
|
||||
::
|
||||
|
||||
>_ false
|
||||
>_ echo $status
|
||||
1
|
||||
|
||||
|
||||
Zero is considered success, and non-zero is failure. There is also a ``$pipestatus`` list variable for the exit statues of processes in a pipe.
|
||||
|
||||
|
||||
Combiners (And, Or, Not)
|
||||
------------------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue