Execute FIND command with php
<p>I am trying to execute the following command with PHP.</p>

<p>Any one have a better suggestion or and idea why it does not work?</p>

<p>Looking at the error log doesn't provide any useful info...</p>

<p>Command : </p>

<pre><code>$pp = shell_exec(find /direcotry/*.jpg -maxdepth 1 -type f -print0 | xargs -0 ls -l | gawk '{sum += $5; n++;} END {print \"Total Size: \" sum/1024/1024 \" MB : Avg Size: \" sum/n/1024 \" KB : Total Files: \" n ;}';
</code></pre>

<p>Log :</p>

<pre><code>[Mon Jan 28 11:08:27 2013] [error] [client X.X.X.X] PHP Parse error:  syntax error, unexpected T_VAR in /var/www/html/report/functions/avgSize.php on line 15
</code></pre>
