🔍 See Original Answer on Ask Ubuntu ⧉ 🔗
Why is exit code 0 a Success and 1 a Failure
May 27, 2018
Edited: May 27, 2018
September 20, 2023
Copy to clipboard: false
/assets/js/search.js will update text..
There can be many reasons for an error and a parent process will often know what specifically went wrong with a child process. As such 0 is used for success and 1 to 255 provides flexibility for failure reason(s).
For example a child process could return:
1File not found
2User not authorized
3File locked by another process
4Connection not active
6Process cancelled by user