以下のように awk コマンドを使用して、html テーブル形式でメールを送信しようとしています。
(
echo "From: "
echo "Subject: testing of html table using awk"
awk 'BEGIN{print "<table>"} {print "<tr>";for(i=1;i<=NF;i++)print "<td>" $i"</td>";print "</tr>"} END{print "</table>"}' file.tmp
) | sendmail xxx@yy.com
そして、私のファイル(file.tmp)には以下が含まれています:
AAA 1 1 1 1 0 0
SAP 1 1 1 1 0 0
RTTC 1 1 1 1 0 0
PGW 1 1 1 1 0 0
しかし、私はメールをhtml表形式ではなく、htmlコード自体で受け取っています。
AWK コマンドは正しいですか? または、何か不足していますか?