Created
October 10, 2013 17:50
-
-
Save tt/6922599 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% chruby 1.9.2 | |
% echo "pid = Process.spawn('sh -c \"exit 0\"'); _, status = Process.wait2(pid); warn status.inspect; warn status == 0; warn status.exitstatus == 0" | ruby | |
#<Process::Status: pid 50482 exit 0> | |
true | |
true | |
% echo "pid = Process.spawn('sh -c \"exit 0\"'); _, status = Process.wait2(pid); warn status.inspect; warn status == 1; warn status.exitstatus == 1" | ruby | |
#<Process::Status: pid 50454 exit 0> | |
false | |
false | |
% echo "pid = Process.spawn('sh -c \"exit 1\"'); _, status = Process.wait2(pid); warn status.inspect; warn status == 0; warn status.exitstatus == 0" | ruby | |
#<Process::Status: pid 50327 exit 1> | |
false | |
false | |
% echo "pid = Process.spawn('sh -c \"exit 1\"'); _, status = Process.wait2(pid); warn status.inspect; warn status == 1; warn status.exitstatus == 1" | ruby | |
#<Process::Status: pid 50355 exit 1> | |
false | |
true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment