Why does redirecting the output of a file to itself produce a blank file?
Stated in Bash, why do
less foo.txt > foo.txt
and
fold foo.txt > foo.txt
produce an empty foo.txt? Since an append such as less eggs.py >> eggs.py produces a two copies of the text in eggs.py, one might expect that an overwrite would produce one copy of the text.
Note, I'm not saying this is a bug, it is more likely a pointer to something deep about Unix.