分页: 1 / 1

求助大神这个shell问题出现在哪里

发表于 : 2013-06-28 16:30
liufangj1n
1 #!/bin/bash
2
3 #随机读取一行
4 s=$(awk '{a[NR]=$0}END{srand();i=int(rand()*NR+1);print a}' /root/subject)
5
6 r=$(cat /root/receiver)
7
8#随机读取目录内容
9 c=$(find /root/content -type f | awk -vR=$RANDOM '{a[NR]=$0}END{print a[R%NR+1]}')

10 for (( i = 0; i < 5; i++))
11 do
12 mail -s $s ${r[$i]} < $c
13
14 done

运行后出现的提示:
root@xxx:~# bash sendscipt
mail: You must specify direct recipients with -s, -c, or -b
mail: You must specify direct recipients with -s, -c, or -b
mail: You must specify direct recipients with -s, -c, or -b
mail: You must specify direct recipients with -s, -c, or -b

Re: 求助大神这个shell问题出现在哪里

发表于 : 2013-06-28 16:52
麦斯特
先弄清楚你那该死的mail命令的用法吧,或者直接在bash后面加个v,自然有更加详细的东西了。

Re: 求助大神这个shell问题出现在哪里

发表于 : 2013-06-28 17:14
liufangj1n
root@xxx:~# bash v sendscipt
root@xxx:~#


加了v之后连提示都没有了

Re: 求助大神这个shell问题出现在哪里

发表于 : 2013-06-28 19:21
aerofox

代码: 全选

bash -v sendscipt