首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

linux 上 mail程序有关问题

2012-08-30 
linux 下 mail程序问题C/C++ code#include stdio.halias elmmailxelm -s test user@xx.comtest.lo

linux 下 mail程序问题

C/C++ code
#include <stdio.h>alias elm='mailx'elm -s "test" user@xx.com<test.log


我的一个mail程序mail.sh

上面的程序可以发mail了

但是我想把mail list单独存在一个地方便于维护,因此mail list如下

C/C++ code
maillist.confMAILLIST=user@xx.com user2@xx.com user3@xx.com; export MAILLIST


然后我的sh更改如下
C/C++ code
. /home/someuser/somesdir/maillist.conf#include <stdio.h>alias elm='mailx'elm -s "test" $MAILLIST<test.log


但是这样报错

[解决办法]
chmod +x maillist.conf
[解决办法]
. /home/someuser/somesdir/maillist.conf
完了以后
echo $MAILLIST 看看对不对

然后手动运行 
mailx -s "test" $MAILLIST<test.log 
看看对不对

热点排行