The command compgen
works fine in the Linux Terminal, but causes a panic when using Command::new.
My code:
use std::process::Command;
fn main() {
let status = Command::new("compgen")
.status()
.expect("failed to execute process");
println!("process exited with: {}", status);
}
The error message:
Compiling terminal v0.1.0 (file:///home/user/programmates/RUST/Terminal/terminal)
Finished dev [unoptimized + debuginfo] target(s) in 0.66 secs
Running `target/debug/terminal`
thread 'main' panicked at 'failed to execute process: Os { code: 2, kind: NotFound, message: "No such file or directory" }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.