I have two programs in bash:
{ { sleep 1s; kill 0; } | { while true; do echo "foo"; done; kill 0;} }
and
{ { while true; do echo "foo"; done; kill 0; } | { sleep 1s; kill 0; } }
(just changed order).
How is it possible that the first one writes a lot of "foo" in the output and the second one writes nothing?