For future reference: In a shell script, if I have to pass an unknown number of command line arguments to another command, and some of the arguments might contain spaces, here’s how to do it:
#!/bin/sh othercmd --foo --bar "$@"
The magic “$@” invocation in double quotes does the trick. The more natural “$*” doesn’t work because it doesn’t keep arguments with spaces intact.
(Thanks go to Paolo who actually figured it out.)
Thank you for sharing, I had been searching for this!