<?xml version="1.0" encoding="windows-1252"?>
<node id="120770" title="Re: Array for system() call" created="2001-10-23 12:53:34" updated="2005-07-27 15:29:59">
<type id="11">
note</type>
<author id="90987">
MZSanford</author>
<data>
<field name="doctext">
When &lt;code&gt;system()&lt;/code&gt; gets a scalar, it goes to the shell to execute the command. This means that you open a new shell instance (such a ksh), and run the program, including any redirection.&lt;br&gt;&lt;br&gt;
If &lt;code&gt;system()&lt;/code&gt; gets an array, it instead does the &lt;code&gt;fork()&lt;/code&gt; and then uses &lt;code&gt;exec()&lt;/code&gt; to start the process. This by-passes the shell, so shell redirection does not work. 
&lt;HR&gt;
&lt;i&gt;i had a memory leak once, and it ruined my favorite shirt.&lt;/i&gt;</field>
<field name="root_node">
120765</field>
<field name="parent_node">
120765</field>
</data>
</node>
