you could write a shell script but it wouldnt be very efficient.. At least of the top of my head I cant think how to do it without reading a file as many times as there are lines.
awk would probably be a better solution.
shell would look something like this.
Code:
#!/bin/bash
#Source file to read from
fileA=filea.txt
#File to check against
fileB=fileb.txt
num_lines=`wc -l $fileA | sed "s/\(^[0-9]*\).*/\1/"`
let cnt=1
while [ $cnt -le $num_lines ]
do
line=`sed -n ${cnt}p $fileA`
if grep "$line" $fileB
then
echo "LINE# $cnt exists in $fileB"
fi
let cnt++
done