How do I handle output in a shell script from a PHP script that has output to either STDOUT or STDERR?
Suppose I have the following PHP script being run on the PHP CLI in a shell script: <?php # foo.php $a = rand(1,5); if ($a == 1) { fwrite(STDOUT, 'normal condition'); } else { fwrite(STDERR, 'error condition'); } The script…