hg2 has asked for the wisdom of the Perl Monks concerning the following question:
IF i redirect stderr to stdout in a ksh script the output is not interleafed as it happens but rather appears to come in chunks (buffered from separate buffers). How can I get perl to output stdout and stderr to the same output file as they happen - would make debugging so much easier, e.g.,
script.pl > script.out 2>script.outwould result in output like
error1 error2 error3 abc def ghi
What i want is
abc def error1 error2 ghi error3
where error1 and error2 occur after def and before ghi, and error3 after ghi, and the errors are perl generated errors
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: interleaf stdout stderr to a file
by BrowserUk (Patriarch) on Mar 03, 2015 at 02:57 UTC | |
by hg2 (Initiate) on Mar 03, 2015 at 15:19 UTC | |
|
Re: interleaf stdout stderr to a file
by kennethk (Abbot) on Mar 03, 2015 at 00:42 UTC | |
by hg2 (Initiate) on Mar 03, 2015 at 15:12 UTC |