There is a line containing the chosen terminator, but it is not by itself on a separate line. In the example code, the script uses <<-eof, which makes it look for eof but skips the intended terminator since it starts with a dash.