You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

29 lines
696 B

  1. #!/usr/bin/env sh
  2. #-*-mode: Shell-script; coding: utf-8;-*-
  3. # File: ddiff.sh
  4. # Copyright: 2016 Mitch Tishmack
  5. # Description: Stupid recursive directory diff
  6. export script=$(basename "$0")
  7. export dir=$(cd "$(dirname "$0")"; pwd)
  8. export iam=${dir}/${script}
  9. rc=0
  10. src="$1"
  11. dest="$2"
  12. cd "$src" || exit 1
  13. for file in $(find . -type f -print); do
  14. ffile=$(echo "$file" | sed -e 's|\.\/||')
  15. dfile=$(echo "${dest}/${file}" | sed -e 's|\.\/||')
  16. if [ -e "${dfile}" ]; then
  17. diff -u "${ffile}" "${dfile}"
  18. rc=$((rc + $?))
  19. else
  20. echo "source file ${ffile} not found in ${dest} as ${dfile}, ignoring"
  21. fi
  22. done
  23. if [ $rc != 0 ]; then
  24. echo differences between ${src} and ${dest}
  25. fi
  26. exit $rc