I have a running bash script, that runs a program 'n' times in a loop. That program opens a txt for example, counts, then write another txt. At the start of the script, it deletes all of the output txts. But if I kill the running script with Ctrl-Z, and I want to delete all of the txt-s, or the program itself, I can't delete the txts that the program actually counted with, it writes the text is 'busy'. I could understand why it works like that, but in another ubuntu, i could delete all of them.
How can I handle this?