From: Avdi Grimm Date: 2008-12-04T12:28:25+09:00 Subject: Re: rescuing a failed %x[] call? On Wed, Dec 3, 2008 at 6:02 PM, Kyle Schmitt wrote: > I know it should be streightforward, but I'm not finding the docs anywhere... > > How does one go about rescuing a failed shell command? like in the > instance it fails, or the command isn't found? According to some experiments in IRB, the failed shell command won't raise an exception; it will leave a non-zero exit code in the $? special variable. You'll need to check the value of $? and take action accordingly. -- Avdi Home: http://avdi.org Developer Blog: http://avdi.org/devblog/ Twitter: http://twitter.com/avdi Journal: http://avdi.livejournal.com