use std::process::Command; use std::fs::File; fn main() { let code = File::open("code.sh").unwrap(); Command::new("sh").stdin(code).spawn().unwrap(); }