bash script use heredoc to store text as file code example
Example: bash here document example
cat << EOF > file.txt
The current working directory is: $PWD
You are logged in as: $(whoami)
EOF
cat << EOF > file.txt
The current working directory is: $PWD
You are logged in as: $(whoami)
EOF