1
0
mirror of https://github.com/php/doc-ja.git synced 2026-04-28 02:23:18 +02:00
Files
archived-doc-ja/reference/exec/functions/exec.xml
T
Rui Hirokawa c1d753be2a modified the misused kanji.
git-svn-id: https://svn.php.net/repository/phpdoc/ja/trunk@176274 c90b9560-bf6c-de11-be94-00142212c4b1
2005-01-02 07:23:48 +00:00

88 lines
3.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.5 $ -->
<!-- EN-Revision: 1.2 Maintainer: hirokawa Status: ready -->
<refentry id="function.exec">
<refnamediv>
<refname>exec</refname>
<refpurpose>外部プログラムを実行します</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>exec</methodname>
<methodparam><type>string</type><parameter>command</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter role="reference">output</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter role="reference">return_var</parameter></methodparam>
</methodsynopsis>
<para>
<function>exec</function>は指定された
<parameter>command</parameter>を実行しますが、一切の出力はありま
せん。ただ単に、コマンド結果の最後の行を返すだけです。コマンドを実行
し、一切干渉を受けずに直接コマンドから全てのデータを受けとる必要が
あるならば、<function>PassThru</function> 関数を使ってください。
</para>
<para>
引数<parameter>output</parameter>が存在する場合、指定した配列は、
コマンドからの出力の各行で埋められます。
<literal>\n</literal>のような行末記号は、この配列には含まれません。
配列に既に何らかの要素が
含まれる場合は、<function>exec</function>は配列の最後に追加される
ことに注意してください。関数が要素を追加することを望まないのなら、
それが <function>exec</function> に渡される前に、配列の
<function>unset</function>を呼び出してください。
</para>
<para>
引数<parameter>return_var</parameter>が、引数
<parameter>output</parameter>と共に存在する場合、実行したコマンドの
ステータスがこの変数に書かれます。
</para>
<para>
<example>
<title>An <function>exec</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
// outputs the username that owns the running php/httpd process
// (on a system with the "whoami" executable in the path)
echo exec('whoami');
?>
]]>
</programlisting>
</example>
</para>
&warn.escapeshell;
&note.exec-bg;
&note.exec-path;
&warn.sm.exec;
<para>
<function>system</function>,
<function>passthru</function>, <function>popen</function>,
<function>escapeshellcmd</function>
<function>pcntl_exec</function>, <link
linkend="language.operators.execution">バックティック演算子</link>
も参照ください。
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->