I have a summary file which needs to be displayed with formatting as it is in the OS to the mail.
Summary.txt
@@@@@@@@@@@@@
Total files deleted: 55
@@@@@@@@@@@@@
Total Files fixed :77
Path :/tmp
But when mail is sent the formatting is lost ( i even tried cat -e)
@@@@@@@@@@@@@ Total files deleted: 55 @@@@@@@@@@@@@ Total Files fixed :77 Path :/tmp
Following is the code, can anyone help me to preserve the formatting
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
try this:
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
note: you can split a shell command over multiple lines by using \
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.