Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

output

Runs a shell command and returns its stdout on success.

If the underlying command exits with a non‑zero status, an error is returned which message includes the exit code.

let uname = shell::output("uname -s").unwrap();
assert!(uname.len() > 0);

let result = shell::output("false");
assert!(result.is_err());

Fully qualified path: shell::output

pub fn output(command: ByteArray) -> Result<ByteArray, Error>