1

I need to redirect output & error streams from one Windows process (GNU make.exe executing armcc toolchain) to some filter written on perl. The command I am running is:

Make Release 2>&1 | c:\cygwin\bin\perl ../tools/armfilt.pl

The compilation process throws out some prints which should be put then to STDOUT after some modifications. But I encountered a problem: all prints generated by the make are actually postponed till end of the make's process and only then are shown to a user. So, my questions are:

  1. Why has it happen? I have tried to change the second process (perl.exe) priority from "Normal" to "Above normal" but it didn't help...
  2. How to overcome this problem?
  3. I think that one of possible workarounds may be to send only STDERR prints to the perl (that is what I actually need), not STDOUT+STDERR. But I don't know how to do it in Windows.

The Microsoft explanation concerning pipe operator usage says:

The pipe operator (|) takes the output (by default, STDOUT) of one command and directs it into the input (by default, STDIN) of another command.

But how to change this default STDOUT piping is not explained. Is it possible at all?

gaussblurinc
  • 3,642
  • 9
  • 35
  • 64
RedSoft
  • 373
  • 2
  • 15
  • `make.exe 1>output.txt 2>errors.txt` – gaussblurinc Apr 17 '13 at 14:18
  • @loldop - redirection the stdout & stderr to different files is not a problem. The problem is to redirect stderr only using the pipe (|) to another process... – RedSoft Apr 17 '13 at 14:31
  • yeah, I understand your problem. Maybe really better to write wrapper-script over this? STDERR to file, then read it, why not? – gaussblurinc Apr 17 '13 at 14:38
  • maybe this question can help? [stderr and stdout tricks](http://stackoverflow.com/questions/12273866/is-there-a-way-to-redirect-only-stderr-to-stdout-not-combine-the-two-so-it-can) – gaussblurinc Apr 17 '13 at 14:44

0 Answers0