An exit code, or sometimes known as a return code, is the code returned to a parent process by an executable. The exit status of a process in computer programming is a small number passed from a child process to a parent process when it has finished executing a specific procedure or delegated task.

The terminology for exit code is somewhat confusing, as people may call error codes “return codes” or “exit codes”. In any case, interpreting those numbers helps observers to understand why a program crashed. On POSIX systems the standard exit code is 0 for success and any number from 1 to 255 for anything else.

POSIX or the Portable Operating System Interface is a standard application programming interface (API) used by Linux and many other operating systems (typically UNIX and UNIX-like systems). It makes it easier to write source code that can be compiled on different POSIX systems.

  • 00:00 Introduction
  • 01:15 how to get an exit code of a command
  • 05:00 what exit code should be used
  • 06:00 How to supress exit status

#linux

How to Handle Bash Exit Codes in Linux
5.15 GEEK