Report generation

Hello,
I got a requirement in writing a KSH script in unix, please help me out

the requirement is there are two folders Folder1 and Folder2 and there are same files in the different folders. like file1,file2 in folder1 and file1 and file2 in folder2.

I would like to compare all the similar files in the two folders and generate a report where this report should have filename and Matched(Y/N)

If the files are similar then Y else N.

Thanks in advance

Mahesh

What have you tried so far? Are you aware of the diff and comm commands? Have a read of their man pages.

try soemthing like this

for file in /folder1/* 
do
     file2="/folder2/`basename $file`"
     if [[ -r $file2 ]] ; then
         cksum $file | read one dummy1 dummy2
         cksum  $file2 read two dummy1 dummy2
         echo "$file   $file2 \c"
         if [[ "$one" = "$two" ]] ; then
                 echo "Y"
         else
                 echo "N"
         fi
     fi
done

Thanks you jim