1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00
node-red/packages/node_modules/@node-red/nodes/locales/zh-TW/function/90-exec.html
2020-02-10 11:31:37 +09:00

75 lines
4.6 KiB
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<script type="text/x-red" data-help-name="exec">
<p>運行系統命令並返回其輸出</p>
<p>可以將節點配置爲等待命令完成或者在命令生成時發送其輸出</p>
<p>運行的命令可以在節點中配置也可以由收到的消息提供</p>
<h3>輸入</h3>
<dl class="message-properties">
<dt class="optional">payload <span class="property-type">字符串</span></dt>
<dd>如果這樣配置則將被附加到執行命令中</dd>
<dt class="optional">kill <span class="property-type">字符串</span></dt>
<dd>指定發送到現有的exec節點進程的kill信號類型</dd>
<dt class="optional">pid <span class="property-type">數值|字符串</span></dt>
<dd>要殺死的現有exec節點進程的進程ID</dd>
</dl>
<h3>輸出</h3>
<ol class="node-ports">
<li>標准輸出(stdout)
<dl class="message-properties">
<dt>payload <span class="property-type">字符串</span></dt>
<dd>命令的標准輸出</dd>
</dl>
<dl class="message-properties">
<dt>rc <span class="property-type">object</span></dt>
<dd>僅執行模式一個返回代碼對象的副本在端口3上也可用</dd>
</dl>
</li>
<li>標准error輸出(stderr)
<dl class="message-properties">
<dt>payload <span class="property-type">字符串</span></dt>
<dd>命令的標准錯誤輸出</dd>
</dl>
<dl class="message-properties">
<dt>rc <span class="property-type">object</span></dt>
<dd>僅執行模式一個返回代碼對象的副本在端口3上也可用</dd>
</dl>
</li>
<li>返回代碼
<dl class="message-properties">
<dt>payload <span class="property-type">object</span></dt>
<dd>一個包含返回代碼以及<code>message</code><code>signal</code></dd>
</dl>
</li>
</ol>
<h3>詳細</h3>
<p>默認情況下使用<code>exec</code>調調<code>{code0}</code></p>
<p>可選可以選擇使用<code>spawn</code>stdoutstderr<code>{code0}</code></p>
<p>錯誤可能會在第三個端口<code>msg.payload</code><code>message</code><code>signal</code></p>
<p>運行的命令是在節點內定義的帶有附加<code>msg.payload</code></p>
<p>帶空格的命令或參數應該用引號引起來<code>這是一個參數</code></p>
<p>返回的<code>有效荷載</code>通常是<i>字符串</i>類型除非檢測到非UTF8字符在這種情況下它會是<i>buffer</i></p>
<p>節點處于活動狀態時該節點的狀態圖標和PID將可見對此更改可以通過<code>Status</code></p>
<h4>殺死進程</h4>
<p>發送<code>msg.kill</code><code>msg.kill</code><code>SIGINT</code><code>SIGQUIT</code><code>SIGHUP</code><code>SIGTERM</code></p>
<p>如果節點有多個進程在運行則還必須設置<code>msg.pid</code>PID</p>
<p>如果<code>超時</code></p>
<p>提示如果運行Python應用程序則可能需要使用<code>-u</code></p>
</script>