I would never do it myself but people with Windows machines insist on putting spaces in filenames.
I've composed this detailed command which works perfectly except for the files with spaces in them. Have tried everything, single quotes, double quotes, ticks, escape with backslash.
The command is supposed to copy everything from a directory with certain file extensions, except a list of files which I don't want copied. Unfortunately some of those files contain spaces. This is the command:
cp $(ls *.txt *.docx | grep --invert-match --fixed-strings \
-e not_this_one.txt \
-e not_this_one_either.docx \
-e "no not me.txt" \
-e "please leave me out as well.docx") ./destination_directory/
Any ideas how to make this work?