I'm in the "use Python instead of shellscript" gang to avoid rm -rf issues where the whole user home is nuked. Recursively traverse a directory if it exists and then remove only the files you need to remove. More convoluted, but also much safer.
You could also just rm the files individually in shellscript as well to be honest.
https://super8.absturztau.be/watch?v=qzZLvw2AdvM