Shell 脚本分隔符错误

Shell 脚本分隔符错误

我已经编写了以下脚本来发送 o/p 邮件。

#!/bin/sh

input="/data/builds/i2SchedulerAutomation/Final.txt"
tmpfile="/data/builds/i2SchedulerAutomation/Final.html"

echo 'Content-Type: text/html; charset="us-ascii"' > "$tmpfile"
awk 'BEGIN{print "<html><body><table border=1>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table></body></html>"}' "$input" >> "$tmpfile"

/usr/bin/mail -s "i2BuildReport" [email protected] <<-$tmpfile

执行时出现以下错误:

./Table.sh: line 10: warning: here-document at line 9 delimited by end-of-file (wanted `$tmpfile')

有人能解决这个问题吗?谢谢

相关内容