Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.0.2 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Input/Output functions > 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に誤った命令が含まれていると、

  • OSからのエラーメッセージがScilabコンソールに表示されます
  • unix_sが停止し、独自のエラーメッセージが表示されます。
  • 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

参照

  • unix_g — いくつかのWindows、LinuxまたはMacOS命令を実行し、変数で出力する
  • unix_w — いくつかのWindows、LinuxまたはMacOS命令を実行し、結果をScilabコンソールに表示する
  • unix_x — いくつかのWindows、LinuxまたはMacOS命令を実行する: 結果はポップアップメッセージボックスに表示される
  • host — executes a Windows, Linux, or MacOS command
  • powershell — executes a command with the Windows powershell interpreter (Windows only)
  • setenv — 環境変数の値を設定e
  • getos — オペレーティングシステムの名前とバージョンを返す
Report an issue
<< unix_g Input/Output functions unix_w >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 15:02:14 CET 2019