0

I am trying to write a simple CLI in Rust.

let output = Command::new("which")
        .arg("brew")
        .output()
        .expect("Failed to execute command");

I would like to get output in the form of a string for comparison. How do I do that?

Sven Marnach
  • 574,206
  • 118
  • 941
  • 841
TheGeorgeous
  • 3,927
  • 2
  • 20
  • 33
  • 2
    The `Output` struct has a [`stdout`](https://doc.rust-lang.org/std/process/struct.Output.html#structfield.stdout) member which you can use together with the dup question. – hellow Feb 11 '20 at 08:18
  • 1
    "use together with the dup question" implies that this question is not a duplicate. Someone's standards are way too high for what is/isn't considered a duplicate. – richardpringle Feb 13 '20 at 18:43

0 Answers0