22件ヒット
[1-22件を表示]
(0.044秒)
検索結果
-
Open3
. # pipeline(*cmds) -> [Process :: Status] (120.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。
...のコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を H......require "open3"
fname = "/usr/share/man/man1/ruby.1.gz"
p Open3.pipeline(["zcat", fname], "nroff -man", "less")
#=> [#<Process::Status: pid 11817 exit 0>,
# #<Process::Status: pid 11820 exit 0>,
# #<Process::Status: pid 11828 exit 0>]
例2:
require "open3"
Open3.pipeline(......[{"LANG"=>"C"}, "env"], ["grep", "LANG"], "less")
@see Open3.#popen3... -
Open3 (14.0)
-
プログラムを実行し、そのプロセスの標準入力・標準出力・ 標準エラー出力にパイプをつなぎます。
...off プロセスの標準出力から処理結果を受け取る。
require "open3"
stdin, stdout, stderr = *Open3.popen3('nroff -man')
# こちらから書く
Thread.fork {
File.foreach('/usr/man/man1/ruby.1') do |line|
stdin.print line
end
stdin.close # または clo...