executes some Windows, Linux or MacOS instructions: output canceled (Silent mode)
unix_s(commands)
Single text containing some Windows, Linux, or MacOS instructions.
unix_s(…)
opens a new session of the Operating System (OS) command
interpreter (sh with Linux, cmd.exe with
Windows, etc..), sends commands
to it,
lets it processing commands
instructions, receives the possible
error message yielded by the processing, and closes the interpreter session.
The starting working directory and environment variables of the opened interpreter are set as described for host().
The standard output of processed instructions is ignored: Nothing is displayed neither in the Scilab console nor in the OS terminal (Windows consolebox).
If an instruction in commands
generates an error,
unix_s
stops and displays its own error message.commands
, the remaining unprocessed instructions are ignored.![]() | The effects of valid instructions processed before the erroneous one remain actual
(for instance, deleted files).
commands with multiple instructions are not recommended.
They are more difficult to debug. |
if getos() == 'Windows' then unix_s("del foo"); else unix_s("rm -f foo"); end | ![]() | ![]() |