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
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.