Cmd
Module | ejs.sys |
Definition | class Cmd |
Inheritance | Cmd ![]() |
Specified | ejscript-1.1 |
Stability | Prototype. |
The Cmd class supports invoking other programs on the same system.
This class is prototype and will likely change in the next release.
Properties
Qualifiers | Property | Type | Description |
---|---|---|---|
No properties defined |
Cmd Methods
Qualifiers | Method |
---|---|
public static | daemon(cmdline: String): Number |
Execute a command and detach. | |
public static | locate(program: Path): Path |
Locate a command along the system search PATH. | |
public static | run(cmdline: String, data: String = null): String |
Execute a command/program. | |
public static | sh(cmdline: String, data: String = null): String |
Run a command using the system command shell and wait for completion. |
Method Detail
Execute a command and detach.
- Description
- This will not capture output nor will it wait for the command to complete.
- Parameters
cmdline: String Command or program to execute.
- Returns
- The commands process ID.
Locate a command along the system search PATH.
- Parameters
program: Path Program to search for.
- Returns
- The first located occurence of the command on the PATH.
Execute a command/program.
- Parameters
cmdline: String Command or program to execute. data: String Optional data to write to the command on it's standard input. Not implemented.
- Returns
- The command output from it's standard output.
- Throws
- IOError: if the command exits with non-zero status. The exception object will contain the command's standard error output.
Run a command using the system command shell and wait for completion.
- Description
- This supports pipelines.
- Returns
- The command output from it's standard output.
- Throws
- IOError: if the command exits with non-zero status. The exception object will contain the command's standard error output.