to_s -> String[permalink][rdoc]-
実行結果を文字列で返します。
require 'shell' Shell.def_system_command("wc") sh = Shell.new sh.transact { puts (cat("/etc/passwd") | wc("-l")).to_s }
このマニュアルは既にメンテナンスが終了したバージョンの Ruby を対象としています。 最新版のマニュアルへ
to_s -> String[permalink][rdoc]実行結果を文字列で返します。
require 'shell'
Shell.def_system_command("wc")
sh = Shell.new
sh.transact {
puts (cat("/etc/passwd") | wc("-l")).to_s
}