Hi radoulov,
nice solution with the subshells
, but unfortunately this does also not work at all.
This works well if you have outputs to stdout and stderr alternating, but if there is more then one lines written to one of stdout or stderr, the numbering increases for this one, but not for the other one ...
Just tried it out
...
But I will explain, why I was searching for a solution for this:
It's pretty simple and thats way very annoying that this not works with some standard shell features or some additional command.
I have to execute some php script on command line where some messages are written to stdout and some messages are written to stderr from within the script itself.
Furthermore there maybe is some, warning, notice, fatal error or exception thrown from the php interpreter itself, which cannot be catched within php, thats a limitation of php.
And I just want to get both stdour and stderr written from the script to separate files and to console just in the order like they are written ...
The problem is a general one which each other script language or binary, where on cannot catch all errors or cannot modify the binary ...
Since this seems not to go in any way, I decided to solve this problem as smart as I can, even if this is not really the solution I wished
.
Thanks for your help and the nice ideas ... I learned some new stuff even if the problem is not solved ... but learning new stuff is always good
.
Bye
Steffen