From: pustoi@... (Arthur Korneyew) Date: 2004-12-05T22:17:38+09:00 Subject: Check comand status in ruby Hello, How can I check comand status in Ruby ? In perl I'm usually using something like that: $cmd="mv $srcdir/$file $dstdir/$dstfile > /dev/null 2>&1"; $result=system($cmd); $status=$result >> 8; if ($status eq '0') { &Logit("Ok"); } else { &Logit("Not Ok"); &Logit("$!"); } I have tried this code in Ruby but it does not working as I wish: IO.popen("/usr/bin/cd /tmp") { |process| result = process.gets if (result == nil) logToScreen "Ok" else logToScreen "Not Ok" end } Many thanx !