求助大神这个shell问题出现在哪里
发表于 : 2013-06-28 16:30
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
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