Apparently you have not been bitten by a filename expansion bug when shell scripting. This kind of thing is fairly common with bash and some of the other ones when dealing with files that have spaces/newlines/whatever. It boils down to learning and knowing your tools and how to work around their limitations.
In this case, if you're not an expert with bash, a good rule of thumb would be to pipe your glob-expanded list of junk into perl -nle 'print' (or echo, or... etc) before running something destructive.