Scenario:
$ cat t0.txt
xxx
$ grep xxx t0.txt > t0.txt
grep: t0.txt: input file is also the output
exit status 2
$ cat t0.txt
<nothing>
Question: if input file is also the output AND the exist status is 2
(an error occurred), then why clearing the input file?