I have written a small script which will send me mail on status of server.
I have tested it working fine. I am facing only with message subject
The last part of my script is as below,
cat dailystatus.txt| mail -s "Daily Server Status Report-$yr-$mm-$dd" email@example.com
The script run perfectly . The variable yr, mm. dd are defined and that is not a problem I have tested it too. But when I receive the mail , I got the subject heading as "Daily Server Status Report-$yr-$mm-$dd" . The variable are not getting replaced by the values,
So I feel that it may not be allowed to put variables with mail command.
Is there is any way so that subject can be read from file. Or any other idea on this.