从文件中按行读取,读取一行进行一行对比,对比成功,打印,并且跳出循环
[root@localhost opt]# cat shell.sh
#! /bin/bash
YUMING=/opt/ip
#IPUB=awk -F ")" '{print $1}' /opt/ipub.txt |awk -F "(" '{print $2}' |awk -F "/" '{print $1}'
#IPUB=cat ipub.txt |awk -F ")" '{print $1}' |awk -F "(" '{print $2}' |awk -F "/" '{print $1}'
IUB=/opt/ipub.txt
##cat $IUB | awk -F ")" '{print $1}' |awk -F "(" '{print $2}' |awk -F "/" '{print $1}' | while read line ;do
while read line
do
while read name
do
URL=`echo $line | awk -F ")" '{print $1}' |awk -F "(" '{print $2}' |awk -F "/" '{print $1}' `
if [ $URL = $name ];then
echo $line
continue
fi
done < $YUMING
done < $IUB
阅读(683) | 评论(0) | 转发(0) |