I\'m trying to substitute a string variable, containing multiple quoted words, as a parameter to a command.
Thus, given the following example script (Note the -x in
If you want to pass a variable value as a parameter (99% of cases on SO), simply use proper quoting:
arg="foo bar" command "$arg"
If you want to pass several arguments, use arrays:
args=("foo bar" "baz ban" bay) command "${args[@]}"