executes some Windows, Linux or MacOS instructions: output in variables This function is obsolete. Please use host instead.
[rep, status, msgerr] = unix_g(command)
A single text: instruction(s) to be executed
String: standard output.
Integer, the OS command error status.
String: error message.
unix_g(…) executes a command on the Operating system using CMD on Windows or sh on Linux and macOS.
Scilab receives the standard output and possible error message yielded by the command execution.
It uses CMD on Windows and sh on Linux and MacOS
The starting working directory and environment variables of the opened interpreter are set as described for host().
The standard output is recorded in the variable rep.
The standard error is recorded in the variable msgerr.
When the unix_g is called without msgerr, the error is printed in the Scilab console.
function d=DIR(path) path = pathconvert(path,%t,%t) if getos() == 'Windows' then d = unix_g('dir '+path) else d = unix_g('ls '+path) end endfunction DIR('SCI/etc') | ![]() | ![]() |
| Version | Description |
| 2026.0.0 | Tagged obsolete, use host instead. |