Also referred to as an exit code or a result code, an exit status is the number returned by a computer process to its parent when it terminates. Its purpose is to indicate either that the software operated successfully, or that it failed somehow.
The value of an exit status is an integer. Usually, the value 0 indicates that the exiting process was successful, and 1 (or greater) indicates that it failed.
In the bash shell, errorlevel may be accessed by the special environment variable ?, for example:
true; if [ $? -eq 0 ]; then echo "True."; else echo "Wait, shouldn't that be true?"; fi