whatis heredoc
Heredoc
Also known as: here document, <<EOF
Shell syntax (<<EOF ... EOF) that feeds a multi-line block of text into a command's standard input.
What Is a Heredoc in Bash?
A heredoc is the cleanest way to write a config file or pass a multi-line SQL query from a script. Everything between the opening <<MARKER and a line containing only MARKER becomes stdin.
Variables are expanded inside a heredoc unless you quote the marker (<<'EOF'). Using <<- strips leading tabs so you can indent the block inside functions.
Example
cat <<'EOF' > /etc/motd
Authorized use only.
EOF Learn more about Heredoc
- Heredocs and Process Substitution in Bash Feed multi-line text to a command without a temporary file, and present a command's output where a filename is expected. Two syntaxes that remove most of the need for temporary files in scripts.