in reply to EOF in string
First confirm that the second "text" is indeed flush left in column zero and spelled right. Then a question: is this the whole script? I've found problems with Win32 editors and having here-docs that end on the last line of the script. Apparently Win32 "text files" don't need a trailing newline (as Unix would expect) and this screws up the parser somehow. Put an extra blank line at the end of the script after the end of the here-doc.