Browse Source

find does not produce sorted output. Help it.

Zachary Kotlarek 13 years ago
parent
commit
5d5516c4df
1 changed files with 2 additions and 2 deletions
  1. 2 2
      sync.sh

+ 2 - 2
sync.sh

@@ -28,9 +28,9 @@ fi
 
 # Grab directory tree lists
 TMP_LOCAL="`mktemp -t sync.local.XXXXXXXX`"
-(cd "${BASE_LOCAL}" && find "${SUB_DIR}" > "${TMP_LOCAL}")
+(cd "${BASE_LOCAL}" && find "${SUB_DIR}" | sort > "${TMP_LOCAL}")
 TMP_REMOTE="`mktemp -t sync.remote.XXXXXXXX`"
-(cd "${BASE_REMOTE}" && find "${SUB_DIR}" > "${TMP_REMOTE}")
+(cd "${BASE_REMOTE}" && find "${SUB_DIR}" | sort > "${TMP_REMOTE}")
 
 # Diff to find the first mis-matched file
 DIFF="`diff -u "${TMP_LOCAL}" "${TMP_REMOTE}" | grep "^[\+\-]${SUB_DIR}"`"