I'm testing random number generator and I need to pass it's output to various tests. Since RNG is relatively slow compared to tests and I need to test 0.5-1TB of data I came up with idea to use tee to pass the data from RNG to all the tests. The main benefit is that I need only to generate the data ones. The command is
./RNG | tee >(test1) >(test2) >(test3) >/dev/null
However, it does not work as expected. When for example test1 finishes, tee will stops all other test even when they need more data to finish.
You can see the problem with command:
cat /dev/zero | tee >(head -c200M | md5sum) >(head -c10M | sha1sum) | wc -c
Output is: 10559568
I would expect that tee will finish after all child process will finish but it's not the case. It will stop after first process will finish (in this case head -c10M | sha1sum). What can I do to change this behaviour?