Escape $ properly in heredoc