For this particular case:
cat "$(echo "Filename\ With\ Spaces.txt")"
Since the case is a bit contrived, I can't really say what the correct thing is for your actual situation. What is meant by a "list of files"? Is that a list of files that are separated by newlines? How will you handle files that contain a newline in the name? Is it a list of null separated files, or is the list comma separated? In general, my opinion would be that the correct solution is to ban the use of whitespace in filenames. If that's not an option, the general principle would be to always put quotes around any string that may contain elements of IFS.
However. (Note this "however" should be read as "the following is a terrible hack that should never be done because the correct approach is to ban the use of whitespace in filenames"). Assuming that by a "list of files" you mean that each name is distinguished from the next by the presence of a newline in the string, you might try something like:
printf '1st name\n2nd name\n' | { a=(); while read arg; do a+=("$arg"); done;
cmd "${a[@]}"
}
The above will invoke cmd
with each line as a single argument. It would be much more reasonable to require that the list of inputs be zero separated, which would allow you to use xargs
with something like:
printf '1st name\0002nd name\000' | xargs -0 cmd
Until you properly define what you mean by "list of files", no robust solution is possible.