|
|
|
|
|
by copirate
720 days ago
|
|
You can pipe with the `pipeline*` method of open3 which is part of the stdlib: For example: require "open3"
last_stdout, wait_threads = Open3.pipeline_r("cat /etc/passwd", ["grep", "root"])
last_stdout.read # => "root:x:0:0::/root:/bin/bash\n"
wait_threads.map(&:value).map(&:success?) # => [true, true]
https://ruby-doc.org/3.2.2/stdlibs/open3/Open3.html |
|