Shell脚本发送电子邮件

编程入门 行业动态 更新时间:2024-10-09 08:26:46
本文介绍了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脚本发送电子邮件

本文发布于:2023-10-12 16:17:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485249.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:脚本   发送电子邮件   Shell

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!