I'm trying to distribute very long make output using following methodmkfifo myfifo make 2>&1 | tee myfifo | grep -E errors|warnings myfifo > errors.log | cat myfifoIdea is that subset of output should be copied to log files, while whole output would be redirected to stdout of console.It seem to work at first, but suddenly stops and stays frozen until i press Ctrl-Z. A use of process substitutionmake 2>&1 | tee >(grep -E errors|warnings > errors.log)is not possible, because shell compiled with  default strict POSIX compliance.platform - ubuntu-flavored distro. shell bash 4.2 (and only one available)
distribute output through FIFO
bash;grep;pipe;fifo
Thatmake 2>&1 | tee myfifo | grep -E errors|warnings myfifo > errors.log | cat myfifo          P1           P2                                              P3command makes little sense. It starts those 4 commands concurrently with pipes in between:make 2>&1: stdout and stderr goes to P1tee myfifo: stdin from P1, stdout to P2. So tee writes the output to both myfifo and P2.grep -E errors|warnings myfifo > errors.log: stdin from P2 but you're passing a filename (myfifo) to grep, so grep won't read from its stdin. stdout goes to errors.log, nothing writes to P3cat myfifo: stdin from P3 but again as cat is given a filename, it reads it instead. So both grep and cat read from myfifo concurrently.Since nothing reads from P2, tee will hang when P2 is full. Also cat will not display the portions of myfifo that have been read by grep.make 2>&1 | tee myfifo | grep -e errors -e warnings > errors.log | cat myfifois closer to what you meant I think. Again P3 is not used, but we're using the | to start cat concurrently and wait for it.Or you could do:make 2>&1 | tee myfifo & grep -e errors -e warnings > errors.logwaitIf you need more greps, you need more fifos:make 2>&1 | tee fifo2grep1 fifo2grep2 &grep errors fifo2grep1 > errors.log &grep warnings fifo2grep2 > warnings.logwaitOn systems that support /dev/fd/x, you can also do:make 2>&1 | { tee /dev/fd/3 | grep -e errors -e warnings 3>&-; } 3>&1(that's typically what process substitution does in shells that support it).With 2 greps, that becomes:make 2>&1 | {   {     tee /dev/fd/3 /dev/fd/4 |       grep errors > errors.log 3>&- 4>&-   } 4>&1 |     grep warnings > warnings.log 3>&- } 3>&1