I have 2 files
diff.txt
0x21
0xc0a80129
0xc0a80101
0xc0a80108
and abc.txt
0x21
0xc0a80101
0xc0a80108
0xc0a80129
I want to compare these 2 files.
The code that I have so far is
counter=1
exec 4< diff.txt
while read -u4 line
do
grep "$line" abc.txt 1>/dev/null
if [[ $? -eq 1 ]]
then
echo "Line $counter is not in the abc.txt file!!!" | tee $var.txt
fi
(( counter += 1 ))
done
even when te 2 files are similar the output that I get iss
Line 4 is not in the abc.txt file!!!