capture2(*cmd)
Class Public methods
::capture2 captures the standard
output of a command.
stdout_str, status = Open3.capture2([env,] cmd... [, opts])
The arguments env, cmd and opts are passed to ::popen3 except opts and opts. See Process.spawn.
If opts is specified, it is sent to the
command's standard input.
If opts is true, internal pipes are set to binary
mode.
Example:
# factor is a command for integer factorization.
o, s = Open3.capture2("factor", :stdin_data=>"42")
p o #