echo "1\n2\n3\n4\n" > numbers && cat numbers | { sleep 1 && cat > numbers && cat numbers ; }
That's not exactly the same (because the redirection for cat #2 now happens in a subshell), but it shows that this is basically racy. :)
echo "1\n2\n3\n4\n" > numbers && cat numbers | { sleep 1 && cat > numbers && cat numbers ; }
That's not exactly the same (because the redirection for cat #2 now happens in a subshell), but it shows that this is basically racy. :)