Follow

xshell[0] is going to be super nice for replacing shell scripts with code. Invocation goes like this:

filename = "foo bar";
output = cmd!("file", filename).read().unwrap();

- no shell is actually being run, you don't have to worry about inadvertant expansions (eg. variable or whitespace expansions)
- non-zero exit codes are returned as Result::Err, so you have to handle those

[0]: docs.rs/xshell/0.1.3/xshell/in

Sign in to participate in the conversation
Mastodon

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!