-
Notifications
You must be signed in to change notification settings - Fork 24
Exit Code
Exit code (or Return code) is a number that is returned by the Operating System when a program exits (terminates). This article contains information about several aspects of exit codes.
Exit codes are used in a variety of situations in PC². For example, the CLICS Validator returns an exit code of 42 (indicating "Yes/Accepted/Passed Validation") or 43 (indicating "No/Failed Validation"). Any other exit code from a CLICS Validator is considered a system error.
** Unix exit codes
In Unix-like systems, the current value of the exit code can be displayed as follows:
echo *?
Note that this prints the exit code for the command immediately preceding
the echo
command. For Example:
$ foo
$ echo $?
42
$ echo $?
0
The "exit code" in a Windows-based system, referred to as the error level, can be displayed as follows:
echo %ERRORLEVEL%
Note that this prints the exit code for the command immediately preceding the echo.