Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Process::Status#to_s

stat.to_s → string

Show pid and exit status as a string.

Example
system("false")
p $?.to_s         #=> "pid 12766 exit 1"
See also #to_i #termsig also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1