3 ms·
You are right and I was wrong. I do however routinely run into cases where some chain | tee inputfile.txt > /dev/null also results in lost data. I will
by ComputerGuru 10y ago
You are right and I was wrong.
I do however routinely run into cases where
some chain | tee inputfile.txt > /dev/null
also results in lost data. I will try to find it.
- jstimpfle 10y agoThat's a similar case, with the difference that there is a race condition here. "some chain" and "tee" are started in parallel, and it's a random process who comes first: "some chain" for opening inputfile for reading, or "tee" for opening (a new file, but with the same name) it for writing. You can provoke it by echo a > a (sleep 1; cat a) | tee a very likely "a" is empty now.
- ComputerGuru 10y agoThat makes sense. Thank you. `rewrite` should work in those cases.