Unix and Linux Discussions Tagged with exit code |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
4 |
2,993 |
Shell Programming and Scripting |
|
|
|
3 |
1,637 |
Shell Programming and Scripting |
|
|
|
7 |
20,211 |
Shell Programming and Scripting |
|
|
|
3 |
6,893 |
Shell Programming and Scripting |
|
|
|
8 |
6,130 |
Shell Programming and Scripting |
|
|
|
3 |
18,663 |
Shell Programming and Scripting |
|
|
|
5 |
8,957 |
Shell Programming and Scripting |
|
|
|
8 |
7,784 |
Shell Programming and Scripting |
|
|
|
0 |
10,117 |
Shell Programming and Scripting |
|
|
|
16 |
15,161 |
UNIX and Linux Applications |
|
|
|
1 |
3,097 |
UNIX for Dummies Questions & Answers |
|
|
|
1 |
12,116 |
Shell Programming and Scripting |
|
|
|
4 |
3,241 |
UNIX for Dummies Questions & Answers |
|
|
|
8 |
5,628 |
Shell Programming and Scripting |
|
|
|
1 |
13,641 |
Shell Programming and Scripting |
|
|
|
3 |
20,943 |
Shell Programming and Scripting |
|
|
|
4 |
14,856 |
UNIX for Dummies Questions & Answers |
|
|
|
2 |
7,416 |
UNIX for Advanced & Expert Users |
|
|
|
3 |
26,916 |
Programming |
|
|
|
1 |
2,161 |
UNIX for Dummies Questions & Answers |
exit(1T) Tcl Built-In Commands exit(1T)
__________________________________________________________________________________________________________________________________________________
NAME
exit - End the application
SYNOPSIS
exit ?returnCode?
_________________________________________________________________
DESCRIPTION
Terminate the process, returning returnCode to the system as the exit status. If returnCode isn't specified then it defaults to 0.
EXAMPLE
Since non-zero exit codes are usually interpreted as error cases by the calling process, the exit command is an important part of sig-
nalling that something fatal has gone wrong. This code fragment is useful in scripts to act as a general problem trap:
proc main {} {
# ... put the real main code in here ...
}
if {[catch {main} msg]} {
puts stderr "unexpected script error: $msg"
if {[info exist env(DEBUG)]} {
puts stderr "---- BEGIN TRACE ----"
puts stderr $errorInfo
puts stderr "---- END TRACE ----"
}
# Reserve code 1 for "expected" error exits...
exit 2
}
SEE ALSO
exec(1T), tclvars(1T)
KEYWORDS
exit, process
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+--------------------+-----------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+--------------------+-----------------+
|Availability | SUNWTcl |
+--------------------+-----------------+
|Interface Stability | Uncommitted |
+--------------------+-----------------+
NOTES
Source for Tcl is available on http://opensolaris.org.
Tcl exit(1T)