How to write lines in a file, HereDoc (Here Document)
EOF is a delemiter.
A delemiter can be EOF or _end_of_block or any other word.
# write characters in file.txt
cat > file.txt << EOF
...
...
...
EOF
# or
cat << EOF > file.txt
...
...
...
EOF
# with white spaces or tabs:
cat > file.txt <<- EOF
... ...
... ...
... ...
EOF
# with variables:
TODAY=$(date +%F)
cat << EOF
# User defined variables
Today date is = ${TODAY}
#Environ Variables
I am running as = ${USER}
My home dir is = ${HOME}
I am using ${SHELL} as my shell
EOF
# Inside Statements and Loops
#!/bin/bash
if true;
then
cat <<- "END"
Hello
World
END
fi
https://de.wikipedia.org/wiki/Heredoc
https://tldp.org/LDP/abs/html/here-docs.html
https://linuxtldr.com/heredoc/
https://phoenixnap.com/kb/bash-heredoc
https://www.docker.com/blog/introduction-to-heredocs-in-dockerfiles/