2

I want to make a shell-pipe like this:

producer | analyser > report.txt

and watch the output of producer while it is generating data (a big log-file) for analysis.

How can I do that?

sblair
  • 12,757
Bastl
  • 213

1 Answers1

5

In /bin/sh and compatibles:

producer | tee /dev/fd/3 | (analyser > report.txt) 3>&1

I've tested this only on Linux and Cygwin. On some Unix-likes you may have to change /dev/fd/3 to whatever their equivalent is.

reinierpost
  • 2,300