18/01/31 01:31:31.84 ah9e2u9N.net
>>732-734
外部コマンドをバッククォートで囲むとか、IO.popen を使って、
終了ステータス「$?」で分岐する
Rubyで外部コマンドを実行して結果を受け取る方法あれこれ
URLリンク(qiita.com)
resText = ""
IO.popen("where notepad") { |io| resText = io.read }
puts "終了ステータス : #{$?}"
puts resText
出力結果
終了ステータス : pid 9872 exit 0
C:\Windows\System32\notepad.exe
C:\Windows\notepad.exe