jackster the jackle wrote:
> $? equals 0, however if I change the path to js.txt to something that 
> doesn't exist in order to make it fail, $? has a value of 256.

That's because the low-order 8 bits of $? encode something different; 
the next 7 bits are the exit code (0 to 127). Use $?.exitstatus to get 
that.

http://www.ruby-doc.org/core/classes/Process/Status.html

> I thought $? should always have a value of 1 when it fails? Why is it 
> 256?

The exit status in this case is 256 >> 8, which is 1.
-- 
Posted via http://www.ruby-forum.com/.