るりまサーチ

最速Rubyリファレンスマニュアル検索!
22件ヒット [1-22件を表示] (0.138秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:pipeline_rw[x]

別のキーワード

  1. _builtin to_h
  2. env to_h
  3. hash to_h
  4. ostruct to_h
  5. struct to_h

ライブラリ

モジュール

検索結果

Open3.#pipeline_rw(*cmds) -> [IO, IO, [Thread]] (24308.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。

...以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を Hash で指定します。...
...ド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。

(1) commandline
(2) [commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]

@return ブロッ...
...配列で返します。

例:

require "open3"

Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
stdin.puts "foo"
stdin.puts "bar"
stdin.puts "baz"

# sortコマンドにEOFを送る。
stdin.close

# stdinに渡した文字列をsortコマンド...

Open3.#pipeline_rw(*cmds) {|first_stdin, last_stdout, wait_thrs| ... } -> () (24308.0)

指定したコマンドのリストをパイプで繋いで順番に実行します。最初の コマンドの標準入力に書き込む事も最後のコマンドの標準出力を受けとる事も できます。

...以下のように String か Array で指定します。
commandline にはコマンド全体(例. "nroff -man")を表す
String を指定します。
options には Hash で指定します。
env には環境変数を Hash で指定します。...
...ド名を表す String を指定します。
1、2、3 は shell 経由で実行されます。

(1) commandline
(2) [commandline, options]
(3) [env, commandline, options]
(4) [env, cmdname, arg1, arg2, ..., options]
(5) [env, [cmdname, argv0], arg1, ..., options]

@return ブロッ...
...配列で返します。

例:

require "open3"

Open3.pipeline_rw("sort", "cat -n") {|stdin, stdout, wait_thrs|
stdin.puts "foo"
stdin.puts "bar"
stdin.puts "baz"

# sortコマンドにEOFを送る。
stdin.close

# stdinに渡した文字列をsortコマンド...