Bash Here Document
A here document (heredoc) gives a command several lines of input, written right in the script.
It starts with << and a word, and ends with a line that has only that word. Variables inside are replaced, unless the word after << is quoted.
Print several lines
Save this as welcome.sh:
#!/bin/bash
name="Emma"
cat << EOF
Hello, $name!
You have $((2 + 3)) new messages.
EOF
Run it:
./welcome.sh
Hello, Emma!
You have 5 new messages.
Keep the text as written
Save this as literal.sh:
#!/bin/bash
name="Emma"
cat << 'EOF'
Hello, $name!
EOF
Run it:
./literal.sh
Hello, $name!