Who wrote the script? Meaning of non-zero exit is often attributed by the author.
Some standard definitions are usually located in errno.h
You can find this, e.g. at /usr/include/asm-generic/errno.h
Now, -1 is a special number because in two's complement binary representation it corresponds to all 1's (255 for an 8 bit integer)
I think it usually corresponds to "unknown error," though I may be totally mistaken.
If you're a C programmer, the "perror()" function will
print the traditional meaning of an error code for you and "strerror()" will return it as a string.
Here's some quick (not guaranteed to be perfect) example code:
Code:#include <stdio.h> #include <string.h> int main(int argc, char* argv[]) { int i; for(i=1;i<argc;i++) printf("%d: %s\n",atoi(argv[i]), strerror(atoi(argv[i]))); return 0; }
References:
`man errno`
http://www.gnu.org/s/bash/manual/htm...it-Status.html


Reply With Quote
Bookmarks