11件ヒット
[1-11件を表示]
(0.043秒)
モジュール
- Open3 (11)
検索結果
-
Open3
. # pipeline(*cmds) -> [Process :: Status] (6108.0) -
指定したコマンドのリストをパイプで繋いで順番に実行します。
...リストを指定します。それぞれのコマンドは
以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します......(1) commandline
(2) [commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]
@return 実行したコマンドの終了ステータスを配列で返します。
例1:
require "open3"
fname = "......an1/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"...