Also, for the case of passing multiple arguments to a command, just use an array:
SOMETHING=(foo bar)
grep "${SOMETHING[@]}"
It will handle arguments with spaces correctly, unlike using a string variable and splitting it on spaces. There is no reason to ever use space splitting, unless you're maintaining some legacy interface where you can only pass a string instead of an array.
Also, for the case of passing multiple arguments to a command, just use an array:
It will handle arguments with spaces correctly, unlike using a string variable and splitting it on spaces. There is no reason to ever use space splitting, unless you're maintaining some legacy interface where you can only pass a string instead of an array.