One of the lines in my shell script does this:
I parse "output.txt" to find all the release notes and files that have been changed. In fact, one of the reasons I want to redo this in Perl is that I believe I can do this part of the job more efficiently in Perl. No real problem here. Very basic programming stuff.$ cvs rlog -r$OLD::$NEW -SN $module 2> errors.txt > output.txt
The problem is with the "errors.txt" file. I take this file, and do quite a bit of parsing:
First I grep out all the lines that say "warning: no revision `$OLD' in" in one file. I then grep out all the lines that say "warning: no revision `$NEW' in" another file. After that, I do a unified diff on the two outputs. Lines that start with a "-" are for files that have been added since release $OLD. Lines that start with a "+" are for files that have been deleted since release $OLD.
It takes quite a bit of processing. First, I have to capture STDERR in a file, grep it twice, diff it, parse the output and separate out the file name from the rest of the resulting lines.
It should be much, much easier in Perl. I could do everything in a single pass and avoid all temporary files.
However, that's the problem. I can do an "open" on the CVS command to capture STDOUT as if it was a simple text file. But, how in the world do I process the STDERR from that CVS command at the same time? I could (like I do in Kornshell) save the output in a file, and open that file later, but it strikes me there has to be a way I can operate on both STDOUT and STDERR at the same time.
In reply to Parsing STDERR and STDOUT at the same time by qazwart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |