SystemExecute
Executes a system process/command on the underlying OS.
Returns a struct with the following keys:
{ output : [ the command output ] error : [ any errors emitted by the command ] timeout : [ boolean value as to whether a timeout was reached ] terminated : [ boolean value as to whether the process was terminated ] pid : the PID of the process }
Method Signature
SystemExecute(name=[string], arguments=[any], timeout=[long], terminateOnTimeout=[boolean], directory=[string], output=[string], error=[string], inheritEnvironment=[boolean], environment=[struct])Arguments
name
string
true
The process name or binary path ( e.g. bash or /bin/sh )
arguments
any
false
The process arguments ( e.g. for java --version this would be --version )
timeout
long
false
The timeout to wait for the command, in seconds ( default unlimited )
terminateOnTimeout
boolean
false
Whether to terminate the process/command if a timeout is reached
false
directory
string
false
A working directory to execute the command from
output
string
false
error
string
false
An optional file path to write errors to
inheritEnvironment
boolean
false
Whether to inherit the parent process environment variables. Defaults to true.
true
environment
struct
false
A struct of environment variables to pass to the process. Merged in after the inherit decision.
{}
Examples
Execute a system command
Result: true
Execute with working directory
Result: true
Related
Last updated
Was this helpful?
