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