我需要我的脚本从terminal发送电子邮件。 根据我在这里看到的以及在线其他许多地方,我把它格式化为这样: /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的行。 我尝试用其他东西(ENDOFMESSAGE,FINISH等)replaceEOF,但无济于事。 几乎我在网上find的所有东西都是通过这种方式完成的,而且我真的很新奇,所以我很难自己搞清楚。 任何人都可以提供帮助吗? […]
我在Ruby中有以下代码。 我想把这个代码转换成JavaScript。 JS中的等效代码是什么? text = <<"HERE" This Is A Multiline String HERE
在PHP中使用Heredoc有什么好处,你能举个例子吗?