Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function
executes some Windows, Linux or MacOS instructions: output in Scilab's console
A single text: instruction(s) Windows, Linux or MacOS to be executed.
unix_w(…) 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 standard
output and possible error message yielded by the processing, and closes the interpreter
The starting working directory and environment variables of the opened interpreter are set as described for host().
The standard output returned by the OS is displayed in Scilab's console ("_w" stands for the main Scilab's "Window").
If an instruction in
commands generates an error,
- the error message from the OS is displayed in the Scilab console
unix_wstops and displays its own error message in the Scilab console.
commands, the remaining unprocessed instructions are ignored.
The effects of valid instructions processed before the erroneous one remain actual (for instance, deleted files). However, their standard output is lost: It is not displayed in the Scilab console.
commandswith multiple instructions are not recommended. They are more difficult to debug.
if getos() == 'Windows' then unix_w("dir "+'""'+WSCI+"\modules"+'""'); else unix_w("ls $SCI/modules"); end
- unix_g — executes some Windows, Linux or MacOS instructions: output in variables
- unix_s — executes some Windows, Linux or MacOS instructions: output canceled (Silent mode)
- unix_x — executes some Windows, Linux or MacOS instructions: output in a dedicated window
- host — executes a Windows, Linux, or MacOS command
- powershell — executes a command with the Windows powershell interpreter (Windows only)
- setenv — set the value of an environment variable
- getos — возвращает название операционной системы и версию
|Report an issue|
|<< unix_s||OS_commands||unix_x >>|