title: cargo rust build script - print output of command
body: <p>I am new to rust and cargo, and I am trying to do something very simple!</p>
  <p>I have something like this (in build.rs):</p>
  <pre class="lang-rust prettyprint-override"><code>use std::process::Command;
  
  fn main() {
      Command::new(&quot;echo 123&quot;);
  }
  </code></pre>
  <p>And I want to see the output of the command <code>echo 123</code>. I want <code>123</code> to get printed to the build output (this is mostly to debug what I am doing) and wont be part of the final project.</p>
  <p>I have tried <code>cargo build --verbose</code> - this does not work.</p>
  <p>I can't extrapolate an answer from there posts (and some others like it):</p>
  <ul>
  <li><a href="https://github.com/rust-lang/cargo/issues/985" rel="nofollow noreferrer">https://github.com/rust-lang/cargo/issues/985</a></li>
  <li><a href="https://github.com/rust-lang/cargo/issues/1106" rel="nofollow noreferrer">https://github.com/rust-lang/cargo/issues/1106</a></li>
  </ul>
  <p>I feel this must be simple to do - but I have been stuck for hours looking on the web and not finding the answer.</p>