找出两个文件不同的数据

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#!/bin/sh

function _diffab(){
x=0
for i in `cat $1`;do
        for j in `cat $2`;do
                if [ $i == $j ];then
                        x=1
                        break;
                fi
        done
                if [ $x -ne 1 ];then
                        echo $i
                fi
        x=0
done
}


if [ "$1" == "" ] || [ "$2" == "" ];then
echo "use like this: $0 filea fileb"
else
{
_diffab $1 $2
_diffab $2 $1
}
fi