Guest User

Untitled

a guest
Jun 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. use std::process::Command;
  2.  
  3. fn main() {
  4. let output1 = Command::new("echo")
  5. .arg("ls")
  6. .output()
  7. .expect("dupa");
  8.  
  9. let ls = String::from_utf8_lossy(&output1.stdout).to_string();
  10.  
  11. print!("elo: {}", ls);
  12.  
  13. let output2 = Command::new(ls)
  14. .output()
  15. .expect("dupa");
  16.  
  17. print!("{}", String::from_utf8_lossy(&output2.stdout).to_string())
  18. }
Add Comment
Please, Sign In to add comment