随机生成11位手机号码
时间:2008-03-05 来源:西门子
#!/bin/bash
function rand
{
a=(0 1 2 3 4 5 6 7 8 9 )
for ((i=0;i<8;i++));do
echo -n ${a[$RANDOM % ${#a[*]}]}
done
} for ((i=0;i<20000000;i++));
do
random=$(rand) pns="134
135
136
137
138
139"
pn=($pns)
num_pns=${#pn[*]}
echo "${pn[$((RANDOM % $num_pns))]}$random"
done
function rand
{
a=(0 1 2 3 4 5 6 7 8 9 )
for ((i=0;i<8;i++));do
echo -n ${a[$RANDOM % ${#a[*]}]}
done
} for ((i=0;i<20000000;i++));
do
random=$(rand) pns="134
135
136
137
138
139"
pn=($pns)
num_pns=${#pn[*]}
echo "${pn[$((RANDOM % $num_pns))]}$random"
done
相关阅读 更多 +