(Process.wait2)[1]

my understanding was that Process.wait2[1] would be the child process
exit_status, so this is confusing:

~ > ls -e; echo $?
ls: invalid option – e
Try `ls --help’ for more information.
1

~ > ruby -e ‘fork{exec “ls -e”}; puts((Process.wait2)[1])’
ls: invalid option – e
Try `ls --help’ for more information.
256

~ > ruby -e ‘fork{exec “ls -e”}; puts((Process.wait2))’
ls: invalid option – e
Try `ls --help’ for more information.
3388
256

~ > ruby -e ‘fork{exec “ls -e”}; p((Process.wait2))’
ls: invalid option – e
Try `ls --help’ for more information.
[3399, #<Process::Status: pid=3399,exited(1)>]

obviously 256 is 1 << 8 and this is equivalent to $? - the exitstatus. can
someone eplain what the lower byte is then?

-a

···

ATTN: please update your address books with address below!

===============================================================================

EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
PHONE :: 303.497.6469
ADDRESS :: E/GC2 325 Broadway, Boulder, CO 80305-3328
STP :: Solar-Terrestrial Physics Data | NCEI
NGDC :: http://www.ngdc.noaa.gov/
NESDIS :: http://www.nesdis.noaa.gov/
NOAA :: http://www.noaa.gov/
US DOC :: http://www.commerce.gov/

The difference between art and science is that science is what we
understand well enough to explain to a computer.
Art is everything else.
– Donald Knuth, “Discover”

/bin/sh -c ‘for l in ruby perl;do $l -e “print "\x3a\x2d\x29\x0a"”;done’
===============================================================================

see man 2 wait, and include/sys/wait.h

Andrew Walrond

···

On Thursday 15 Jan 2004 8:06 am, Ara.T.Howard wrote:

obviously 256 is 1 << 8 and this is equivalent to $? - the exitstatus. can
someone eplain what the lower byte is then?