3 ms·
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
by mkl 9y ago
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.