This finds duplicates
Code:
find_dup()
{
awk ' FILENAME=="file1" { arr[$0]++ }
FILENAME=="file2" { if (arr[$0] { print "value is", $0} }
' file1 file2
}
Write a loop that generates one set of filenames - the file1.abc things put it into a file -dirfile1
get another list of the other type of files - call the file dirfile2
Okay now call the find_dup() fuunction for each file combination:
Code:
#/bin/ksh
while read file2
do
while read file1
do
ln -s file1 $file1
ln -s file2 $file2
result=$( find_dup )
if [[ ! -z $result ]] ; then
echo "duplicate found in $file1 and $file2 $result"
fi
done < dirfile1
done < dirfile2 > result.log
result.log will have what you found.