Method: Process.last_status

Defined in:
process.c

.last_statusProcess::Status?

Returns the status of the last executed child process in the current thread.

Process.wait Process.spawn("ruby", "-e", "exit 13")
Process.last_status   #=> #<Process::Status: pid 4825 exit 13>

If no child process has ever been executed in the current thread, this returns nil.

Process.last_status   #=> nil

Returns:



616
617
618
619
620
# File 'process.c', line 616

static VALUE
proc_s_last_status(VALUE mod)
{
    return rb_last_status_get();
}