Thursday, August 7, 2008
"Reserved" Exit Codes - bash shell
1::catchall for general errors[ miscellaneous errors, such as "divide by zero"]
--------------------------------------------------------------------------------
$ let "var1 = 1/0"
-bash: let: var1 = 1/0: division by 0 (error token is "0")
$ echo $?
1
2:: misuse of shell builtins, according to Bash documentation [Seldom seen, usually defaults to exit code 1]
------------------------------------------------------------------------------------------
$ ls /tmp/notexi
ls: /tmp/notexi: No such file or directory
$ echo $?
1
126::"command invoked cannot execute" [permission problem or command is not an executable]
------------------------------------------------------------------------------------------------------------------
$ ./asd
-bash: ./asd: Permission denied
$ echo $?
126
127:: "command not found" [possible problem with $PATH or a typo]
-----------------------------------------------------------------------------------
$ pks -ef
-bash: pks: command not found
$ echo $?
127
130::"script terminated by Control-C"
--------------------------------------------
$ sleep 100
(pressed ^C)
$ echo $?
130
Read in details
Subscribe to:
Post Comments (Atom)
© Jadu Saikia www.UNIXCL.com
No comments:
Post a Comment