why does close() fail miserably on popen with exit code -1 ?!

Jeffrey Schwab jeff at schwabcenter.com
Fri Mar 3 15:58:52 EST 2006


Tobiah wrote:

> phase:toby:~> echo 'exit -1' | bash
> phase:toby:~> echo $?
> 255

http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/exitcodes.html


Exit Code Number:  255 [1]
Meaning:           Exit status out of range
Example:           exit -1
Comments:          exit takes only integer args in the range 0 - 255


[1] Out of range exit values can result in unexpected exit codes. An 
exit value greater than 255 returns an exit code modulo  256. For 
example, exit 3809 gives an exit code of 225  (3809 % 256 = 225).



More information about the Python-list mailing list