Executes an external command and returns stdout on success.
Example:
string? out = Process.execWithOutput ("sh", { "-c", "printf 'hello'" });
assert (out == "hello");
| cmd |
command path or executable name. |
| args |
command arguments. |
|
captured stdout when exit status is 0, otherwise null. |