Since I'm not an expert in shell scripting, I have question on sending script result to file. I have script like this...
if condition=0: then
echo "service is not running" | mail -s "Server Status" uname@companyname
fi
sleep 10
if configtion=1: then
echo "service is not running" | mail -s "Server Status" uname@companyname
fi
else
echo "service is running" | mail -s "Server Status" uname@companyname
fi
script is working fine but getting 3 mails from the server.
Instead sending 3 emails, I want to put all 3 in 1 file, send an email with attached file. Any idea.
when i try this, I got `cat Result` in the mail eventhough there is file.
I tried this...
cat Result mailx -s "SUBJECT" uname@companyname << !END_OF_MSG
then i dont see anything in the mail. but when i ran just out side the script, it works fine.
Any idea. Thanks
---------- Post updated at 10:55 AM ---------- Previous update was at 10:23 AM ----------
it works fine. I think it was my mistake.
to make it just look good in the email, i want to have as it is in the file (one result in one line). But in the email I see all line are combined. Can we do it seperate line in the email. Thanks