mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
docs/tutorial: Rewrite exit status section
We've kinda forgotten the "tutorial" part of this. [ci skip]
This commit is contained in:
parent
a154384ff4
commit
8eb0769996
1 changed files with 6 additions and 1 deletions
|
@ -383,6 +383,8 @@ To write them on the same line, use the semicolon (";"). That means the followin
|
||||||
Exit Status
|
Exit Status
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
When a command exits, it returns a status code as a natural number. This indicates how the command fared - 0 usually means success, while the others signify kinds of failure. For instance fish's ``set --query`` returns the number of variables it queried that weren't set - ``set --query PATH`` usually returns 0, ``set --query arglbargl boogagoogoo`` usually returns 2.
|
||||||
|
|
||||||
Unlike other shells, ``fish`` stores the exit status of the last command in ``$status`` instead of ``$?``.
|
Unlike other shells, ``fish`` stores the exit status of the last command in ``$status`` instead of ``$?``.
|
||||||
|
|
||||||
|
|
||||||
|
@ -393,8 +395,11 @@ Unlike other shells, ``fish`` stores the exit status of the last command in ``$s
|
||||||
1
|
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.
|
This indicates how the command fared - 0 usually means success, while the others signify kinds of failure. For instance fish's ``set --query`` returns the number of variables it queried that weren't set - ``set --query PATH`` usually returns 0, ``set --query arglbargl boogagoogoo`` usually returns 2.
|
||||||
|
|
||||||
|
There is also a ``$pipestatus`` list variable for the exit statuses [#]_ of processes in a pipe.
|
||||||
|
|
||||||
|
.. [#] or "stati" if you prefer, or "statūs" if you've time-travelled from ancient Rome or work as a latin teacher
|
||||||
|
|
||||||
Combiners (And, Or, Not)
|
Combiners (And, Or, Not)
|
||||||
------------------------
|
------------------------
|
||||||
|
|
Loading…
Reference in a new issue