• pranaless@beehaw.org
    link
    fedilink
    arrow-up
    31
    ·
    1 year ago
    use std::process::Command;
    
    fn main() {
        Command::new("sh")
            .arg("-c")
            .arg("echo Hello World!")
            .spawn()
            .unwrap();
    }
    

    Like this?

    • 30p87@feddit.de
      link
      fedilink
      arrow-up
      10
      ·
      1 year ago

      No, more like

      use std::process::Command; fn main() { Command::new("sh").arg("-c").arg("echo Hello World!").spawn().unwrap(); }
      

      .
      Just a little bit shorter, as it seems /s