在提示邮件输出 [英] mail output on prompt

查看:230
本文介绍了在提示邮件输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开发在在后台运行,当相关的东西被发现发送电子邮件的linux的bash脚本。下面是该脚本的邮件code。

I have developed a script in linux bash that is running in background and send emails when something related is found. Here is mail code of that script.

mail -s "Backup File place XYZ.... " "$EMAIL" 

有没有该电子邮件的身体一切是覆盖在主题。但问题是,无论何时发送一封电子邮件,我得到ouptput在控制台上说

There is no body of that email as everything is covered in subject. but problem is that whenever it sends an email i get ouptput on console saying

" Null message body; hope that's ok".... 

现在我想不想要这个文本。我怎么能阻止它。

Now I want dont want this text. how can i stop it.

推荐答案

从猛砸版本4起

mail -s "$text" "$email" &> /dev/null

应该重定向标准输出的的标准错误到/ dev / null的

should redirect stdout and stderr to /dev/null

这篇关于在提示邮件输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆