2012-06-25 105 views
0

我想在shell脚本上通过电子邮件发送zip文件。我知道我需要使用下面的命令:通过shell脚本发送邮件

cat file.txt | mail -s "This is subject" [email][email protected][/email] 

我总是得到这样的错误:

line 13: mail: command not found 

有谁知道在哪里以及如何安装邮件命令?

我正在使用Cygwin来测试我的shell脚本。

回答

0

如果您在Ubuntu中,你可以使用容易

sudo apt-get install mailutils postfix 
+0

没有。我在Cygwin上,它提供了一个在Windows之上的linux层。我得到了“sudo:command not found”错误。 – Sakura

+0

是的,你没有适合cygwin。您必须使用安装程序(称为'setup.exe')并在那里搜索软件包。 –

0

安装 “钉” 或 “mailx的” 包。