本文介绍了Shell脚本发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在linux机器上,我监视进程的使用情况。大多数时间我将远离我的系统,我可以在我的设备上访问互联网。所以我打算写一个可以邮寄过程的输出的shell脚本。
可以吗?
如果是这样,shell脚本如何发送邮件?
请提供一个代码段来开始。
解决方案是的,它可以正常工作,常用:
$ echohello world| mail -s主题someone@somewhere
I am on linux machine and I monitor a process usage. Most of the time I will be away from my system and I have access to internet on my device. So I planned to write a shell-script that can mail me the output of the process.
Is it possible?
If so how to make a shell-script send me mail?
Please provide a snippet to get started.
解决方案Yes it works fine and is commonly used:
$ echo "hello world" | mail -s "a subject" someone@somewhere
更多推荐
Shell脚本发送电子邮件
发布评论