xshell[0] is going to be super nice for replacing shell scripts with #rust 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