I'm trying to capture the output when I execute a command via shell_command but since the implementation returns an empty Ok(()) Result, there is no handle to stdout nor a handle to the buffer. What is the recommended way to capture this output for later use?
I noticed in the implementation of
shell_command
that the responses from the TCP stream are being read into a buffer and then printed tostdout
.I'm trying to capture the output when I execute a command via
shell_command
but since the implementation returns an emptyOk(())
Result, there is no handle to stdout nor a handle to the buffer. What is the recommended way to capture this output for later use?