cLive ;-)'s answer will not work. The initial # will cause itself and the semicolon to be treated as a constant, and therefore the heredoc terminator will be '' and there will be no semicolon afterward... you would have to put single-quotes around the #.