At few examples I can see that tee doesn't wait for stdout to finish, and this results in some buggy behavior.
first example:
seq 50000|tee >(wc) >(head -2) >/dev/null
will output:
1
2
12773 12774 65536
instead of
1
2
50000 50000 288894
second example:
cat f.txt|grep abc|tee f.txt >/dev/null
at this example, the file update will work, only if the file is a short one, but if the file is a long one, sometimes tee will starts writing before cat finishes, and the file update will work only on the first 'cat' transition.
you can say that tee is only for redirecting to files, but I see also those usages with tee.
I know that pee command doesn't have this bug, but anyone knows a workaround to make tee to wait?
thanks :-)