compareFiles()
{
find /tmp/Satya -type f | \
while read filename1
do
echo "----------------------------------------$filename1"
find /tmp/Satya -type f | \
while read filename2
do
if diff $filename1 $filename2
then
echo "Both files are same"
else
cp /tmp/Satya/$filename1 /tmp/Satya/CGTPatterns/$filename1
fi
done
done
}
compareFiles
i am not able to copy the file i am getting an error
cp: cannot stat `/tmp/Satya//tmp/Satya/11.File': No such file or directory
cp: cannot stat `/tmp/Satya//tmp/Satya/11.File': No such file or directory
See the /tmp/Satya/11.File in the above - that is the return from your find command. You will need to
(a) modify your copy command to adjust for the full path
or
(b) strip out for just the filename after you "find" your files