method

capture2e

Importance_1
capture2e(*cmd, stdin_data: nil, binmode: false, **opts) public

Open3.capture2e captures the standard output and the standard error of a command.

stdout_and_stderr_str, status = Open3.capture2e([env,] cmd... [, opts])

The arguments env, cmd and opts are passed to Open3.popen3 except opts[:stdin_data] and opts[:binmode]. See Process.spawn.

If opts[:stdin_data] is specified, it is sent to the command’s standard input.

If opts[:binmode] is true, internal pipes are set to binary mode.

Example:

# capture make log
make_log, s = Open3.capture2e("make")
Show source
Register or log in to add new notes.