Let's say I have two programs: 'foo' and 'bar'. 'foo' always returns an
exit code of 10. 'bar' always exits normally (i.e. returns 0).
If I do: `foo | bar` in my shell, the shell will return 10.
If I do: exec('foo | bar', $ignoreMe, $returnCode) in PHP, $returnCode
will contain 0.
Is there a way to detect a pipe's first process' exit code in PHP ?
Background info and an idea: my shell is tcsh. In the above example,
tcsh and csh report the 10 exit code, whereas bash and sh would return
0. Thus, the above question *might* be equivalent to: "Is there a way to
specify in which shell 'exec' should execute commands?"
Thanks in advance...
--
I am dae3 and I approve my own message.
---------------------------------------'
"Little else matters than to write good code."
(Karl Lehenbauer)