How to handle filenames containing whitespace in Bash

First capture the current IFS in $SAVEIFS and then replace it with a newline instead of spaces, now do your thing and afterwards restore the IFS with $SAVEIFS.

And yes, you can not use new lines in filenames 😉