Skip to content

Latest commit

 

History

History
32 lines (25 loc) · 1.56 KB

File metadata and controls

32 lines (25 loc) · 1.56 KB

Exit Status

Capture exit code

    $?

Send exit code

    # Will exit with status of last command.
    exit $?

     # will terminate the running script and return the exit code of the last command executed before exit.
    exit

Reserved Exit Status

Exit Status Description
0 Success
1 Catchall for general errors
2 Misuse of shell builtins (according to Bash documentation)
126 Command invoked cannot execute
127 "command not found"
128 Invalid argument to exit
128+n Fatal error signal "n"
130 Script terminated by Control-C Ctrl-C is fatal error signal 2, (130 = 128 + 2, see above)
255* Exit status out of range

HOME