I'm trying to echo a string into a file which has variables inside it along with plaintext. and use it later with a command but have the variable be interpreted. I have tried to use eval with limited success but then I cannot include characters such as <>
body=`cat ~/body`;
echo -e "${body}" >> message
message is later used in the following command
sendmail -f [email protected] $recipient < message;
If the contents of message are:
"Hello. The current epoch time is<br>
${EPOCHSECONDS}
"
I'd like the output to have the var interpreted and the body shown as
"Hello. The current epoch time is<br>
1662823014"
Is this possible? Thanks.