title: Different BASH exit status codes
body: <p>I am writing a program in C for x86 Linux. I am wanting to use my own customer exit codes to help the user with debugging problems when the program doesn't execute as expected.</p>
  
  <p>As an example, suppose the program was a command line calculator and I would like to return the following exit codes and document them in the man pages;</p>
  
  <ol>
  <li>Calculation completes and prints results to screen (normal operation) - return 0</li>
  <li>Invalid number of operands supplied (syntax error basically!)  - return 1</li>
  <li>Some other error - return 2</li>
  <li>Another error - return 3</li>
  </ol>
  
  <p>I have seen a few pages like <a href="http://www.tldp.org/LDP/abs/html/exitcodes.html" rel="nofollow">this one</a> which make me think I can't return any exit code I like. Is there any official rules (BASH or Linux standard/guideline) I should be following here, apart from 0 == normal exit?</p>