From: matz@... (Yukihiro Matsumoto) Date: 2000-06-14T17:33:02+09:00 Subject: [ruby-talk:03390] Re: PID of child processes Hi, In message "[ruby-talk:03338] PID of child processes" on 00/06/12, Andrew Hunt writes: |What I'd really like is the pid and the exit status -- but the only |place I can obtain exit status is the global $?; if I spawn a bunch of |child processes and they all exit at roughly the same time, I can't |associate which child exited with which status. Oops, there's no way but $? to retrieve wait status. We had better provide the alternative way, like other magic vairables. Any idea? Using $?, trap("CHLD"){Process.wait; ..using $? ..} should work fine. In addition, this variable is thread independent. matz.