shell脚本
lineIndex=1
lineIp=1
a=("10.110.2.1" "10.110.2.2" "10.110.2.3")
for i in `cat b$my_file.txt`
do
if [ $lineIndex -eq 11 ]
then
lineIndex=1
fi
if [ $lineIp -eq 3 ]
then
lineIp=0
fi
echo ${i} >> ${a[${lineIp}]}_${lineIndex}_${my_file}.txt
lineIndex=`expr $lineIndex + 1`
echo $lineIndex
lineIp=`expr $lineIp + 1`
echo $lineIp
done