Indranil Ganguly Indranil Ganguly - 1 year ago 93
Bash Question

Send Mail using cron job and shell script

I am using cron job to run my shell script after every 2 minutes. My shell script contains pig and hive scripts. I am searching the person with high risk using my hive query and i can get their email id from my hive table, i want to know if i can send mail to the person and how ? I checked on the internet but not able to understand properly, it would be a great help if you guys help me in this. Thanks

Answer Source

This code solves my problem

$ echo "hello world" | mail -s "a subject"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download