Do I need to quote command substitutions?
According to the Google Shell Style Guide , I should: Always quote strings containing variables, command substitutions, spaces or shell meta characters, unless careful unquoted expansion is required. Maybe I am misinterpreting what they mean by "command substitutions", but I am wondering if there is any need to use quotes in the following example: VAR="$(echo foo bar)" Gilles $(echo foo bar) is indeed a command substitution. In this specific example, you don't need double quotes because a variable assignment creates a “double quote context” for its right-hand side, so VAR=$(…) is equivalent to