1

I'm trying to print some html text to an html document with a here-script with the following snippet. $file is sometext.html, and whenever I run this I get an error:

line 126: warning: here-document at line 107 delimited by end-of-file (wanted _EOF_)

#!/bin/bash


echo << _EOF_ 
    <html>
    <head>
        <title>
        $TITLE $HOSTNAME
        </title>
    </head>

    <body>
    <h1>$TITLE</h1>
    <p>$pTIME_STAMP</p>
    $(system_info) <br>
    $(show_uptime) <br>
    $(drive_space) <br>
    $(home_space) <br>
    </body>
    </html>
_EOF_ 

exit 0

Edit: I'm mostly copying the answer from How can I write a here doc to a file in Bash script?

Community
  • 1
  • 1
mtveezy
  • 661
  • 3
  • 10
  • 21

1 Answers1

3

Make sure there is no space before and after the last _EOF_

mtveezy
  • 661
  • 3
  • 10
  • 21