Passing argument containing space in shell script

You must wrap the $@ in quotes, too: "$@"

This tells the shell to ignore spaces in the arguments; it doesn’t turn all arguments into a very long string.

Leave a Comment