here-document gives 'unexpected end of file' error

后端 未结 7 2588
生来不讨喜
生来不讨喜 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 instead of for ident AND using <<-EOF works fine.

    The "-" removes the , not , but at least this works.

提交回复
热议问题