Pegasus said:
While what you write is entirely correct, the command you suggest will not
suppress the error message that the OP wishes to suppress. At least this is
what I think he wishes to achieve.
Except *if* the error is getting caused by trying to delete a file that
doesn't exist because of the parsing at space characters then delimiting
the string with double-quotes gets rid of the error message. Rather
than trying to mask out the error messages, instead eliminate them from
happening in the first place. After all, the OP might think the command
worked but the files remain because the command did NOT execute against
the correct filename.
If the problem is deleting "~this has mult parts.ext" then that file
won't be found if the double-quotes are missing or worse yet the WRONG
files get deleted. The delete command will try to delete 4 files
instead of the one the OP was trying to target. If those files don't
exist, an error happens. If they do exist, the OP just deleted the
wrong files (4 of them instead of just 1).
If the error doesn't occur, there's no need to mask it out.