Skip to main content
InterviewHubPRO
Section Overview
Q10

Question 10 of 50

Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

20%
Bash & Shell Scripting (50 Qs)•Part 1: Basic & Foundational Concepts (Junior / Entry-Level)

What is a Here Document (`<<EOF`) and Here String (`<<<`)?

junior LevelCode Examplebash-shellBasic

In Simple Words:

  • Here Document (<<EOF): Multi-line block of text passed directly into the standard input of a command:
bash
cat <<EOF > config.json
{
  "env": "production",
  "port": 8080
}
EOF
  • Here String (<<<): Passes a single string into stdin: grep "error" <<< "$log_variable".