fn main() { use std::process::Command; let mut child = Command::new("/bin/hostname") .arg("-s") .spawn() .expect("failed to execute child"); let ecode = child.wait() .expect("failed to wait on child"); assert!(ecode.success()); }