Reputation: 6643
I just read the comparison of PHP, Perl, Ruby and Python
http://hyperpolyglot.org/scripting
and saw the following code sample.
files = `ls -l /tmp`
unless $?.success?
raise "ls failed"
end
files = %x(ls)
unless $?.success?
raise "ls failed"
end
I was wondering what $? stands for....
Upvotes: 0
Views: 1161
Reputation:
$?
contains the last executed command's exit code. Which can be accessed as $?.exitstatus
Upvotes: 4