sys_process
Runs a system process with pipe access.
Target
Signature
1sys_process(cmd::string= ?, args= ?, env= ?, user::string= ?)Runs a system process with pipe access.
sys_process constructs or identifies a LaiRu value type. sys_process interacts with logs or child processes. Quote external arguments carefully and keep process output handling explicit.
Parameters
cmd- Optional value of type
string. Supplycmdpositionally unless the signature shows a keyword form. args- Optional value. Supply
argspositionally unless the signature shows a keyword form. env- Optional value. Supply
envpositionally unless the signature shows a keyword form. user- Optional value of type
string. Supplyuserpositionally unless the signature shows a keyword form.
Examples
Basic call
1local(p) = sys_process('/bin/echo', array('hi'))The example keeps process or logging behavior explicit so failures are visible.
Run a process and read output
1[2local(p) = sys_process3#p->open('/bin/echo', array('hello from lairu'))4local(out) = #p->read->decodeBytes5local(status) = #p->wait6#p->close7#out + 'status=' + #status8]Close process handles when you are done with them.