LPIC-1 Shells, Scripting and Data Management Practice Question
A script uses a here-document to pass multi-line input to a command. Which here-document syntax will prevent variable expansion inside the document?
⚠ Common exam trap
The trap here is that candidates mistakenly think double quotes (`<< "EOF"`) also prevent expansion, but in fact double quotes are removed by the shell and do not inhibit expansion, while single quotes (`<< 'EOF'`) are the correct syntax to disable all expansions.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
<< 'EOF'
Single-quoting the delimiter (e.g., `<< 'EOF'`) prevents the shell from performing variable expansion and command substitution within the here-document. The shell treats the quoted delimiter literally, so all content between the start and end markers is passed verbatim to the command.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
<< EOF
Why it's wrong here
Unquoted delimiter allows variable expansion.
- ✗
<<- EOF
Why it's wrong here
Allows leading tabs and variable expansion.
- ✗
<< "EOF"
Why it's wrong here
Double quotes still allow variable expansion.
- ✓
<< 'EOF'
Why this is correct
Quoting the delimiter prevents expansion.
Go deeper
Related to this question
About these practice questions
Courseiva writes every LPIC-1 question from scratch — 527 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This LPIC-1 practice question is part of Courseiva's free LPI certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LPIC-1 exam.