in reply to System Return Code (was: 256)
$? The status returned by the last pipe close, backtick
(``) command, or system() operator. Note that this
is the status word returned by the wait() system
call (or else is made up to look like it). Thus,
the exit value of the subprocess is actually ($? >>
8), and $? & 127 gives which signal, if any, the
process died from, and $? & 128 reports whether
there was a core dump. (Mnemonic: similar to sh and
ksh.)
Just to clarify, $? >> 8 is bitshifting by 8, which is essentially dividing by 256. So, if you are getting
a return val of 256 from system(), your spawned program did
an exit(1).
|
|---|