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 intostdin:grep "error" <<< "$log_variable".