You have a space after the final EOF
hence it was unable to terminate the heredoc.
p/s: Noticed this while copy-pasting your code.
More Related Contents:
- here-document gives ‘unexpected end of file’ error
- How can I write a heredoc to a file in Bash script?
- How to avoid heredoc expanding variables? [duplicate]
- How to assign a heredoc value to a variable in Bash?
- Using variables inside a bash heredoc
- How to suppress variable substitution in bash heredocs
- Passing a variable to a remote host in a bash script with ssh and EOF [duplicate]
- How to use `while read` (Bash) to read the last line in a file if there’s no newline at the end of the file?
- Indenting heredocs with spaces
- What’s the difference between “here string” and echo + pipe
- How can you run a command in bash over and over until success?
- Returning a boolean from a Bash function
- How do I find the number of arguments passed to a Bash script?
- Ignoring specific errors in a shell script
- Capture multiline output as array in bash [duplicate]
- Parallel wget in Bash [duplicate]
- Is there a way to avoid positional arguments in bash?
- Using SED with wildcard
- ^word^replacement^ on all matches in Bash?
- How do I install Bash >= 3.2.25 on Mac OS X 10.5.8?
- escaping newlines in sed replacement string
- How to strip out all of the links of an HTML file in Bash or grep or batch and store them in a text file
- for loop for multiple extension and do something with each file
- How to replace paired square brackets with other syntax with sed?
- “Command not found” when attempting integer equality in bash
- using bash (sed/awk) to extract rows AND columns in CSV files?
- Bash If-statement to check If string is equal to one of several string literals [duplicate]
- How to change a command line argument in Bash?
- Subtract two variables in Bash
- Multidimensional associative arrays in Bash