diff --git a/Sc2086.md b/Sc2086.md index dd5ac88..3e55fb7 100644 --- a/Sc2086.md +++ b/Sc2086.md @@ -11,6 +11,11 @@ The problematic code looks like "print the first argument". It's actually "Split Quoting prevents word splitting and glob expansion, and prevents the script from breaking when input contains spaces, line feeds, glob characters and such. +Note that `$( )` starts a new context, and variables in it has to be quoted separately: + + echo "This $variable is quoted $(but this $variable is not)" + echo "This $variable is quoted $(and now this "$variable" is too)" + ### Contraindications Sometimes you want to split on spaces, like when building a command line.