Skip to content

Instantly share code, notes, and snippets.

Created July 25, 2016 14:57
Show Gist options
  • Save anonymous/2c21ce9e7b919b30cb1444548dc897d9 to your computer and use it in GitHub Desktop.
Save anonymous/2c21ce9e7b919b30cb1444548dc897d9 to your computer and use it in GitHub Desktop.
Shared via Rust Playground
use std::process::Command;
fn main() {
let b = Command::new("/usr/bin/sh")
.args(&["-c", "ls ; sleep 1; ls"])
.stderr(std::process::Stdio::null())
.stdout(std::process::Stdio::piped())
.stdin(std::process::Stdio::piped());
let child = b.spawn().expect("Could not run the command");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment