这里-文档给出了“文件的意外结束”错误我需要我的脚本从终端发送电子邮件。根据我在网上看到的和其他许多地方,我把它格式化如下:/var/mail -s "$SUBJECT" "$EMAIL" << EOF
Here's a line of my message!
And here's another line!
Last line of the message here!
EOF然而,当我运行这个程序时,我会收到这样的警告:myfile.sh: line x: warning: here-document at line y delimited by end-of-file (wanted 'EOF')
myfile.sh: line x+1: syntax error: unexpected end of file.其中x行是程序中最后编写的代码行,y行是/var/mail在里面。我试过替换EOF其他事情(ENDOFMESSAGE, FINISH等等)但没有结果。我在网上找到的几乎所有东西都是这样做的,而且我在bash是个新手,所以我很难自己弄清楚。有人能帮忙吗?
添加回答
举报
0/150
提交
取消