2021-11-12 18:02:56 +01:00
.. _cmd-exit:
2021-11-12 04:34:16 -08:00
.. program :: exit
2019-03-31 11:05:09 +02:00
2018-12-16 17:39:33 -08:00
exit - exit the shell
2019-01-02 20:10:47 -08:00
=====================
2018-12-16 17:39:33 -08:00
2018-12-17 17:58:24 -08:00
Synopsis
--------
2018-12-16 13:08:41 -08:00
2021-11-12 04:20:51 -08:00
**exit** [*code* ]
2018-12-16 13:08:41 -08:00
2018-12-18 18:44:30 -08:00
Description
2019-01-02 20:10:47 -08:00
-----------
2018-12-16 13:08:41 -08:00
2021-12-17 15:16:47 -08:00
**exit** is a special builtin that causes the shell to exit. Either 255 or the *code* supplied is used, whichever is lesser.
2021-11-12 04:51:04 -08:00
Otherwise, the exit status will be that of the last command executed.
2018-12-16 13:08:41 -08:00
2021-11-12 18:02:56 +01:00
If exit is called while sourcing a file (using the :ref: `source <cmd-source>` builtin) the rest of the file will be skipped, but the shell itself will not exit.