I would like to format the mail content before I send, Below is my code,
echo "Time: `$TIMESTAMP_CMD\n\n$EMAIL_BODY" | mail -s "$EMAIL_SUBJECT" ${EMAIL_DIST}
TIMESTAMP_CMD,EMAIL_BODY, EMAIL_SUBJECT and EMAIL_DIST are variables which are defined above this code.
Here, I need line breaks between TIMESTAMP_CMD and EMAIL_BODY. How to achieve it?
Use
Also you use a back-tick in the
echowhich invokesshell. But it seems$TIMESTAMP_CMDholds a shell command. So you’d want something like this,