This won't work with quoted arguments. The problem is that when you convert `$@` to a variable the type changes to a string from an array. Check out the way `ORIG_ARGS` is handled inside of `spark-submit`.