Ruby 3.3 リファレンスマニュアル > ライブラリ一覧 > open3ライブラリ > Open3モジュール > pipeline
pipeline(*cmds) -> [Process::Status][permalink][rdoc]指定したコマンドのリストをパイプで繋いで順番に実行します。
例1
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_ALSO] Open3.#popen3