Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You're using hello.txt as both an input file and an output file, which seems like it's just asking for race-condition problems.

What about using sed -i to make changes to the file, and not doing any bash redirection?

Alternatively, if the real problem is more complex than that, try using a different name for the output file and rename after it's finished.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: