簡體   English   中英

使用mailx發送郵件時的Output格式

[英]Output format when sending the mail using mailx

我有一個摘要文件,它需要在郵件的操作系統中以格式顯示。

摘要.txt

@@@@@@@@@@@@@
Total files deleted: 55

@@@@@@@@@@@@@
Total Files fixed :77
Path :/tmp

但是當發送郵件時,格式會丟失(我什至嘗試過 cat -e)

@@@@@@@@@@@@@ Total files deleted: 55 @@@@@@@@@@@@@ Total Files fixed :77 Path :/tmp

以下是代碼,誰能幫我保留格式

summary=`cat /tmp/Summary.txt`
body="Hi Team, \n\n Find below  summary . \n\n $summary \n\nRegards"
echo -e $body | mail -s "$SID: Job Report" -a $asummary -a $tsummary $mail

嘗試這個:

summary=`cat /tmp/Summary.txt`
echo -e "Hi Team,\n\nFind below summary .\n\n${summary}\n\nRegards" | \
mail -s "$SID:Job Report" -a $asummary -a $tsummary $mail

注意:您可以使用\將 shell 命令拆分為多行

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM