Guest User

Untitled

a guest
May 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. use std::process::Command;
  2.  
  3. fn main(){
  4. let mut v = vec![
  5. Command::new("ls").arg("/").spawn().unwrap(),
  6. Command::new("ls").arg(".").spawn().unwrap()
  7. ];
  8. for x in v.into_iter() {
  9. let stdout = x.wait_with_output().unwrap().stdout;
  10. println!("process output : {}",String::from_utf8_lossy(&stdout));
  11. }
  12.  
  13. }
Add Comment
Please, Sign In to add comment