Bird
0
0

Why does quoting the delimiter in a here document disable variable expansion and command substitution?

hard🧠 Conceptual Q10 of 15
Bash Scripting - Text Processing in Scripts
Why does quoting the delimiter in a here document disable variable expansion and command substitution?
ABecause quoting causes a syntax error
BBecause quoting causes the shell to ignore the here document
CBecause quoting treats the here document content as literal text
DBecause quoting changes the delimiter name
Step-by-Step Solution
Solution:
  1. Step 1: Understand quoting effect on here document

    Quoting the delimiter tells the shell to treat the content literally, disabling expansions.
  2. Step 2: Reason about expansions

    Variable expansion and command substitution are forms of shell interpretation, which quoting disables.
  3. Final Answer:

    Because quoting treats the here document content as literal text -> Option C
  4. Quick Check:

    Quoted delimiter = literal content, no expansion [OK]
Quick Trick: Quoted delimiter means literal text, no expansions inside [OK]
Common Mistakes:
MISTAKES
  • Thinking quoting causes errors
  • Assuming expansions still happen
  • Confusing delimiter name change

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Bash Scripting Quizzes