exit 2

Hi
even though I use exit in my first scripts, I am not sure exactly about exit codes.I know there is a relation between return and exit codes, exit 0 means it returned a 0 to indicate there is no error at the end of this point.
But what does it mean:
exit 1 , probably there was an error, OK then what is it?
exit 2

please let me know, best regards.

The author of the script decides what the exit codes mean. Maybe "exit 1" means a unknown argument was encounted when the script was parsing its arguments. Or maybe "exit 7" means that. It is up to the author to decide. For me "exit 1" usually means the first error that I coded a check for. "exit 2" means the 2nd error I coded a check for. And so on.

Thank you Perderado ,

I fortunately noticed your a tutorial link and want to re-share here,because all answers to my question seems to be there:

http://www.tldp.org/LDP/abs/html/exitcodes.html

:wink: