0

For example I need to set two tee commands in such way that one will be reading from STDOUT and second from STDERR and both redirecting the console output to different files. Is such thing possible in windows batch files ? I know about how to redirect output to file but in this case it won't be displayed on screen or how to combine both streams but how about piping both independently ?

rsk82
  • 28,217
  • 50
  • 150
  • 240
  • What program are you running? Is it a batch file? Can you show the appropriate part? – foxidrive May 27 '13 at 09:22
  • It is a batch file in windows XP, I'm trying to redirect stdout to tee and stderr to sed and then pipe to another copy of tee. So I can see what is error and what is normal output when doing make. – rsk82 May 27 '13 at 12:22
  • Can you reduce the verbosity level of make? – foxidrive May 27 '13 at 13:18
  • I don't want to reduce it, I want to know what's happening. If I need to ease my eyes of particular error I'm doing sed on it for example rewriting long errors. – rsk82 May 27 '13 at 13:20

2 Answers2

3

You may process STDOUT and STDERR with separate programs via the next trick:

(test | findstr /N /A:2A "^" ) 2>&1 1>&3 | findstr /N /A:4E "^"

Previous line show STDOUT output preceded by green numbers and STDERR output preceded by red ones. Just use your TEE program instead findstr...

If you have not an adequate TEE program for Batch files, you may find one here: Displaying Windows command prompt output and redirecting it to a file

Community
  • 1
  • 1
Aacini
  • 65,180
  • 12
  • 72
  • 108
0

You can redirect stdout and stderr to different files but that's about as far as it goes.

If the make output can be time coded on every line then the two files could be adjusted and re-interleaved.

foxidrive
  • 40,353
  • 10
  • 53
  • 68