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#&

stat & num → integer

Logical AND of the bits in stat with num.

Example
fork { exit 0x37 }
Process.wait
sprintf('%04x', $?.to_i)       #=> "3700"
sprintf('%04x', $? & 0x1e00)   #=> "1600"
See also .wait #== #>> also in 3.4 · 3.3 · 3.2 · 3.1