From: Daniel Bretoi Date: 2003-01-24T07:26:34+09:00 Subject: Re: exit status, stderr and stdout So here's what's happening min,out,err = Open3.popen3("ls ---"); p $? >> 8 => 255 system "ls ---" p $? >> 8 => 1 Why am I not getting the right thing with popen3? I still need a way to be able to access stderr, stdout and exit status. Can any one offer alternatives? db On Fri, Jan 24, 2003 at 05:02:04AM +0900, nobu.nokada@softhome.net wrote: > Hi, > > At Fri, 24 Jan 2003 04:33:26 +0900, > Daniel Bretoi wrote: > > This is what I was looking for but I can't seem to be getting the > > appropriate exit value anyway. I tried perl's $? & 127 which didn't give > > it to me either: > > AFAIK, masking $? with 127 is to get the terminating signal. > To get child's exit status, you should right-shift 8 bit. Or > in 1.7 lator, $? is an instance of Process::Status (unless > nil), and has #exitstatus method. > > -- > Nobu Nakada -- Jan 23 Ernst Abbe born, 1840, formulated diffraction theory Jan 23 Humphrey Bogart born in New York City, 1899 Jan 23 John Hancock born, 1737 Jan 23 Joseph Hewes born, 1730 Jan 23 Samuel Barber died, 1981 Jan 23 Feast of St. Ildefonsus Jan 23 National Handwriting Day