Skip to content

Instantly share code, notes, and snippets.

use std::os::unix::process::CommandExt;
use std::process::Command;
// Compile with rustc test_spawn.rs
fn main() {
println!("About to spawn /bin/sh with pre_exec");
let mut cmd = Command::new("/bin/sh");
cmd.arg("-c").arg("echo hello");