2011/07/15

Compare a Copy of a Project

Usage:
compare-projects /home/me/project/ /home/me/old/project/ | grep -v OK > /home/me/compare_result 2>&1
Source: compare-projects
  1. #!/usr/bin/sh
  2.  
  3. #
  4. # settings
  5. #
  6.  
  7. md5=~/bin/md5files
  8.  
  9. #
  10. # inputs
  11. # src: main project
  12. # dst: another project
  13. #
  14.  
  15. src=$1
  16. dst=$2
  17.  
  18. #
  19. # limit file size smaller than 1024k (pass to find)
  20. # md5 all files, and then replace the path to destination
  21. # finally compare the md5 "use md5sum -c"
  22. #
  23.  
  24. $md5 $src -size -1024k | sed "s!${src}!${dst}!g" | md5sum -c 2>&1

沒有留言: