Friday, 1 June 2012

Bash exit status code basics...


bash exit status code basics:

exit status 0
command executed successfully

non-zero exit status
command executed with errors

quick facts about bash exit codes:

variable $?
can be used to determine the exit status of the last executed command.

calling "exit" in bash script without parameter will return the exit code of the last executed command, so "exit" and "exit $?" should return exactly same bash exit code.

No comments:

Post a Comment