[Shell] Compare two files.
查找file1中每一行是否在file2中,若在输出到InRight.txt, 若不在输出到NotInRight.txt.
f1=$1
f2=$2
while read myline
do
grepR=`grep $myline $f2`
if [[ $grepR != "" ]]; then
echo $myline >>InRight.txt
elif [[ $grepR == "" ]]; then
echo $myline >>NotInRight.txt
fi
done < $f1
相关推荐
laisean 2020-11-11
zhangjie 2020-11-11
大牛牛 2020-10-30
firefaith 2020-10-30
liguojia 2020-10-20
wangzhaotongalex 2020-10-20
CARBON 2020-10-20
JohnYork 2020-10-16
xiaonamylove 2020-10-16
Julyth 2020-10-16