Thursday, November 11, 2010

Exit Codes

On Unix, the value of $? would be zero after running the following program: int main() {return 256;}

Unix exit codes go from 0 to 255. If you return or exit with a higher number, the exit code wraps around.
Some examples are: 256->0, 257->1, -1->255. Note that on Windows the range of exit codes are larger.

No comments:

Post a Comment