The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-15-2008
jim mcnamara jim mcnamara is offline
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,849
try soemthing like this
Code:
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
Reply With Quote