execute

Function execute 

Source
pub fn execute(
    command: &str,
    args: &[&str],
) -> Result<(String, String, i32), String>
Expand description

Execute command and capture output

Returns tuple of (stdout, stderr, exit_code)

§Examples

use ruchy::stdlib::process;

let (stdout, stderr, exit_code) = process::execute("echo", &["hello"]).unwrap();
assert!(stdout.contains("hello"));
assert_eq!(exit_code, 0);

§Errors

Returns error if command fails to spawn