Created
December 7, 2021 14:37
-
-
Save tlkahn/36356145867f84055ba4eb8f30b08de2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::process::Command; | |
use std::process::Stdio; | |
fn main() { | |
println!("Hello, world!"); | |
let output = Command::new("ls") | |
.arg("-l") | |
.arg("-a") | |
.stdout(Stdio::piped()) | |
.output() | |
.expect("ls command failed to start"); | |
println!("{}", String::from_utf8_lossy(&output.stdout)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment