Do I need to quote command substitutions?
$(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 VAR=”$(…)”. In bash, you don’t need double quotes in export VAR=$(…) or declare VAR=$(…). But you do need the double … Read more