executeScript

Execute script and return the output. Logs execution on LogLevel.diagnostic and throws an exception on failure.

string
executeScript
(
Range
)
(
Range script
,
const string workdir = null
,)
if (
isInputRange!Range &&
isSomeString!(ElementType!Range)
)

Parameters

script Range

A range command that first filtered for non-null values and escaped by std.process.escapeShellCommand. The output of this script is piped to a shell in [Unofficial Bash Strict Mode]ubsc, ie sh -seu o pipefail.

workdir string

The working directory for the new process. By default the child process inherits the parent's working directory.

logLevel LogLevel

Log level to log execution on.

Return Value

Type: string

Output of command.

Throws

std.process.ProcessException on command failure

ubsc: http://redsymbol.net/articles/unofficial-bash-strict-mode/

Examples

auto greeting = executeScript(["echo", "echo", "rock", "&&", "echo", "roll"]);

assert(greeting == "rock\nroll\n");

Meta