Skip to content

system

miscellaneous · scripts/miscellaneous/system.m

: status = system (cmd)
: [status, output] = system (cmd)
: […] = system (cmd, return_output)
: […] = system (cmd, "-echo")
: […] = system (cmd, env_name, env_value)
: […] = system (cmd, return_output, type)

Run cmd through the system shell.

status is the exit code. With two outputs, standard output is returned in output. "-echo" both returns and prints standard output (MATLAB R2026a). A name/value pair of text scalars sets that environment variable for the child process only.

The boolean return_output flag and "sync" / "async" type are Nexus extensions forwarded to the builtin.