When using the <<-
operator, only leading tabs are stripped from the here document and the line containing the marker. You appear to be indenting the closing marker with spaces, so that line appears to be part of the here document, and since the here document never closes, you reach the end of the file while parsing it.