What is meaning of exit status 1 returned by linux command? Like 127 exit status indicates "command not found".
I have visited http://linux.die.net/abs-guide/exitcodes.html page, does it mean exit status 1 does not have particular special meaning?
Exit status 1 is used in some error messages to indicate that a process has finished (or “exited”) in failure. Other parts of the error message will often contain more specific information. Your error output may end with one of these lines: Compilation error: exit status 1 .
On the basis of above, exit(1) is used as one of the standard error codes which Catches all general errors when checked for the last run command. So any status which is not 0 is considered as failures in shell ,when we want shell script to come out in case of any further we use exit 1(exit with status code 1).
Exit Failure: Exit Failure is indicated by exit(1) which means the abnormal termination of the program, i.e. some error or interrupt has occurred.
Exit code 2 signifies invalid usage of some shell built-in command. Examples of built-in commands include alias, echo, and printf.
The only general convention is that a zero exit status signifies success, whereas any non-zero exit status is a failure.
Many -- but certainly not all -- command-line tools return exit code 1 for syntax error, i.e. you had too few arguments or an invalid option.
Many -- but, alas, not all -- command-line tools have a manual page. By convention, it should document the exit codes of the program, but many do not.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With