[bash] How can I write a heredoc to a file in Bash script?