Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Process::Status#exitstatus
() -> ::Integer?
exitstatus → integer or nil
process.c
View on GitHub ↗
static VALUE
pst_wexitstatus(VALUE st)
{
int status = PST2INT(st);
if (WIFEXITED(status))
return INT2NUM(WEXITSTATUS(status));
return Qnil;
}
Returns the least significant eight bits of the return code of the process if it has exited; nil otherwise:
Example
`exit 99` $?.exitstatus # => 99