I have this simple php script
<?php
echo '<pre>';
// Outputs all the result of shellcommand "ls", and returns
// the last output line into $last_line. Stores the return value
// of the shell command in $retval.
$last_line = $output = system ("~/public_html/cgi-bin/srch.sh &> ~/public_html/errors.txt",$retval);
// Printing additional info
echo '
</pre>
<hr />Last line of the output: ' . $last_line . '
<hr />Return value: ' . $retval;
?>
Which relies on srch.sh:
#!/bin/bash
for i in ~/mail/home/user/mail/domain.com/josh/cur/*
do
grep -i Value $i . &> ~/public_html/yesno.txt;
done
However, all that is display in the b rowser is Retval 1, and no error gets recorded to either of the textfiles. Have I mixed stderr and stdout incorrectly, or missed something else?