mirror of
https://github.com/php/doc-es.git
synced 2026-03-26 00:12:06 +01:00
- Adopcion de documentos de la seccion reference/exec git-svn-id: https://svn.php.net/repository/phpdoc/es/trunk@189205 c90b9560-bf6c-de11-be94-00142212c4b1
145 lines
4.3 KiB
XML
145 lines
4.3 KiB
XML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<!-- EN-Revision: 1.17 Maintainer: lboshell Status: ready -->
|
|
<!-- splitted from ./en/functions/exec.xml, last change in rev 1.2 -->
|
|
<refentry id="function.exec">
|
|
<refnamediv>
|
|
<refname>exec</refname>
|
|
<refpurpose>Ejecutar un programa externo</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>string</type><methodname>exec</methodname>
|
|
<methodparam><type>string</type><parameter>comando</parameter></methodparam>
|
|
<methodparam choice="opt"><type>array</type><parameter role="reference">salida</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter role="reference">var_retorno</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>exec</function> ejecuta el <parameter>comando</parameter>
|
|
dado.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>comando</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
El comando que será ejecutado.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>salida</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Si el argumento <parameter>salida</parameter> está
|
|
presente, entonces la matriz especificada será llenada
|
|
con cada línea de la salida del comando. Los saltos de
|
|
línea, como <literal>\n</literal>, no son incluidos en
|
|
esta matriz. Note que si la matriz ya contiene algunos
|
|
elementos, <function>exec</function> anexará sus
|
|
resultados al final de la matriz. Si no desea que la
|
|
función anexe los elementos, use
|
|
<function>unset</function> sobre la matriz antes de pasarla a
|
|
<function>exec</function>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>var_retorno</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Si el argumento <parameter>var_retorno</parameter> está
|
|
presente junto con el argumento <parameter>salida</parameter>,
|
|
entonces el status de retorno del comando ejecutado será
|
|
escrito en esta variable.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
La última línea de los resultados del comando. Si
|
|
necesita ejecutar un comando y tener todos los datos desde el
|
|
comando pasados directamente de vuelta sin interferencia alguna,
|
|
use la función <function>passthru</function>.
|
|
</para>
|
|
<para>
|
|
Para obtener la salida del comando ejecutado, asegúrese de
|
|
definir y usar el parámetro <parameter>salida</parameter>.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Un ejemplo de <function>exec</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
// imprime el nombre de usuario que tiene control del proceso php/httpd activo
|
|
// (en un sistema con el ejecutable "whoami" disponible en la ruta)
|
|
echo exec('whoami');
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
&warn.escapeshell;
|
|
¬e.exec-bg;
|
|
¬e.exec-path;
|
|
&warn.sm.exec;
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>system</function></member>
|
|
<member><function>passthru</function></member>
|
|
<member><function>escapeshellcmd</function></member>
|
|
<member><function>pcntl_exec</function></member>
|
|
<member><function>system</function></member>
|
|
<member><link linkend="language.operators.execution">operador de
|
|
comilla invertida</link></member>
|
|
</simplelist>
|
|
</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
|
|
-->
|