here-document gives 'unexpected end of file' error

后端 未结 7 2445
生来不讨喜
生来不讨喜 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:44

    Please try to remove the preceeding spaces before EOF:-

    /var/mail -s "$SUBJECT" "$EMAIL" <<-EOF
    

    Using <tab> instead of <spaces> for ident AND using <<-EOF works fine.

    The "-" removes the <tabs>, not <spaces>, but at least this works.

    0 讨论(0)
提交回复
热议问题