here-document gives 'unexpected end of file' error

后端 未结 7 2542
生来不讨喜
生来不讨喜 2020-11-22 04:42

I need my script to send an email from terminal. Based on what I\'ve seen here and many other places online, I formatted it like this:



        
7条回答
  •  自闭症患者
    2020-11-22 05:32

    The EOF token must be at the beginning of the line, you can't indent it along with the block of code it goes with.

    If you write <<-EOF you may indent it, but it must be indented with Tab characters, not spaces. So it still might not end up even with the block of code.

    Also make sure you have no whitespace after the EOF token on the line.

提交回复
热议问题