<< unix_g OS_commands unix_w >>

Scilab Help >> Input/Output functions > OS_commands > unix_s

unix_s

Windows、LinuxまたはMacOSの命令を静かに実行する

呼び出し手順

unix_s(commands)

パラメータ

commands

いくつかのWindows、Linux、またはMacOS命令を含むテキスト。

説明

unix_s()は、オペレーティングシステム(OS)(sh、 Linuxではcmd.exe)のコマンドインタープリタの新しいセッションを開き、 等..)。 次に、commandsがOSインタプリタに送信され、その命令が処理されます。 処理によって得られた標準出力とエラーメッセージが受信され、インタプリタセッションが閉じられます。

開いているインタプリタの開始作業ディレクトリと環境変数は、 host()ページで説明されているように定義されています。

commandsに誤った命令が含まれていると、

The effects of valid instructions processed before the erroneous one remain actual (for instance, deleted files). 複数の命令を持つcommandsはお勧めできません。 それらはデバッグするのがより困難です。

if getos() == 'Windows' then
  unix_s("del foo");
else
  unix_s("rm -f foo");
end

参照


Report an issue
<< unix_g OS_commands unix_w >>