As per definition exit code 128 means 'invalid exit argument'.
But i always get 255 (Exit status out of range) in case argument is invalid like float number.
Is this the proprietary implementation on my linux distribution?
# exit 1.234
exit
bash: exit: 1.234: numeric argument required
$ echo $?
255 //this should be 128?
# exit -1
exit
$ echo $?
255 //this is okay
Best Answer
There is nothing within Bash documentation that says
128
is the required invalid exit code.The last command is the bash builtin
exit
(from man page)Checked specification for WEXITSTATUS.
So exit is restricted to an 8 bit integer ( 0 - 255 ), so
-1
would be255
. Exit only understands an integer argument and not floats, so it's likely kicking out a default-1
.