2021-11-13 01:02:56 +08:00
.. _cmd-exit:
2021-11-12 20:34:16 +08:00
.. program :: exit
2019-03-31 17:05:09 +08:00
2018-12-17 09:39:33 +08:00
exit - exit the shell
2019-01-03 12:10:47 +08:00
=====================
2018-12-17 09:39:33 +08:00
2018-12-18 09:58:24 +08:00
Synopsis
--------
2018-12-17 05:08:41 +08:00
2021-11-12 20:20:51 +08:00
**exit** [*code* ]
2018-12-17 05:08:41 +08:00
2018-12-19 10:44:30 +08:00
Description
2019-01-03 12:10:47 +08:00
-----------
2018-12-17 05:08:41 +08:00
2021-12-18 07: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 20:51:04 +08:00
Otherwise, the exit status will be that of the last command executed.
2018-12-17 05:08:41 +08:00
2021-11-13 01:02:56 +08: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.