variable $CHILD_STATUS

$CHILD_STATUS -> Process::Status | nil[permalink][rdoc] [added by English]

$? の別名

require "English"

out = `wget https://www.ruby-lang.org/en/about/license.txt -O - 2>/dev/null`

if $CHILD_STATUS.to_i == 0
  print "wget success\n"
  out.split(/\n/).each { |line|
    printf "%s\n", line
  }
else
  print "wget failed\n"
end