in reply to file input output problem

When you redirect output to done.txt_ln the shell opens and truncates this file which happens to be the same as done.txt.

At the time your script sees this file it is already truncated.