while read line do a=$line while read line do if [ "$a" = "$line" ]; then sf=`cat B2.log | head -$cnt1 | tail -1` sb=`cat A2.log | head -$cnt2 | tail -1` if [ "$sf" != "$sb" ]; then echo "内容が更新されとるで $a" fi break; fi if [ "$cants" = "$cante" ]; then echo "新規ファイルや $a" else cants=`expr $cants + 1` fi cnt1=`expr $cnt1 + 1` done <B1.log cnt1=1 cants=1 cnt2=`expr $cnt2 + 1` done < A1.log
while read line do a=$line while read line do if [ "$a" = "$line" ]; then break; fi if [ "$cants" = "$cante" ]; then echo "削除ファイルやで $a" else cants=`expr $cants + 1` fi cnt1=`expr $cnt1 + 1` done <A1.log cnt1=1 cants=1 cnt2=`expr $cnt2 + 1` done < B1.log