1EXIT(1P) POSIX Programmer's Manual EXIT(1P)
2
3
4
6 This manual page is part of the POSIX Programmer's Manual. The Linux
7 implementation of this interface may differ (consult the corresponding
8 Linux manual page for details of Linux behavior), or the interface may
9 not be implemented on Linux.
10
12 exit - cause the shell to exit
13
15 exit [n]
16
18 The exit utility shall cause the shell to exit with the exit status
19 specified by the unsigned decimal integer n. If n is specified, but
20 its value is not between 0 and 255 inclusively, the exit status is
21 undefined.
22
23 A trap on EXIT shall be executed before the shell terminates, except
24 when the exit utility is invoked in that trap itself, in which case the
25 shell shall exit immediately.
26
28 None.
29
31 See the DESCRIPTION.
32
34 Not used.
35
37 None.
38
40 None.
41
43 Default.
44
46 Not used.
47
49 The standard error shall be used only for diagnostic messages.
50
52 None.
53
55 None.
56
58 The exit status shall be n, if specified. Otherwise, the value shall be
59 the exit value of the last command executed, or zero if no command was
60 executed. When exit is executed in a trap action, the last command is
61 considered to be the command that executed immediately preceding the
62 trap action.
63
65 Default.
66
67 The following sections are informative.
68
70 None.
71
73 Exit with a true value:
74
75
76 exit 0
77
78 Exit with a false value:
79
80
81 exit 1
82
84 As explained in other sections, certain exit status values have been
85 reserved for special uses and should be used by applications only for
86 those purposes:
87
88 126 A file to be executed was found, but it was not an executable
89 utility.
90
91 127 A utility to be executed was not found.
92
93 >128 A command was interrupted by a signal.
94
95
97 None.
98
100 Special Built-In Utilities
101
103 Portions of this text are reprinted and reproduced in electronic form
104 from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
105 -- Portable Operating System Interface (POSIX), The Open Group Base
106 Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
107 Electrical and Electronics Engineers, Inc and The Open Group. In the
108 event of any discrepancy between this version and the original IEEE and
109 The Open Group Standard, the original IEEE and The Open Group Standard
110 is the referee document. The original Standard can be obtained online
111 at http://www.opengroup.org/unix/online.html .
112
113
114
115IEEE/The Open Group 2003 EXIT(1P)