Exit Codes
Conventions
0= Success: Non-Zero indicates an issue1= Failure2= Failure (due to a usage problem)3-63= Program-Specific Exit Codes64-79= BSD SysExits (https://man.openbsd.org/sysexits.3)80-119= Custom
Many shells use exit codes 126-128 to signal specific error status:
126is for the shell and indicates command found but is not executable.127is for the shell and indicate command not found.128is for invalid argument to exit.
Many shells use exit codes above 128 in their $?; Representation of the exit status to encode the signal number of a process being killed.
128+nmeans fatal error signal “n”- Example:
130means terminated byCTRL+C(BecauseCTRL+Cis signal2) - Example:
137means terminated by kill -9 (because 128 + 9 = 137)
Finally, the highest exit code:
255Exit status out of range (exit takes integer args0-255)