列出重复的文件: hs_duplicate_files.sh
#!/usr/bin/env bash
##############################################################
#@author andrew
#移植麻将的时候部分资源名称重复,列出重复的资源
##############################################################
source ./hs_env.sh
L_SRC_PATH=${G_ROOT_DIR}"/Resources/res"
L_DST_PATH=${G_ROOT_DIR}"/Resources/res"
ALL_FILES=$( find ${L_SRC_PATH} -type f )
SAME_COUNT=0
for FN in ${ALL_FILES[*]}
do
NAME=$(basename ${FN} )
F_COUNT=$(find ${L_DST_PATH} -iname ${NAME} |wc -l )
if [ "${F_COUNT}" -gt 1 ]
then
FILES=$(find ${L_DST_PATH} -iname ${NAME} )
echo ${FILES}
SAME_COUNT=$((${SAME_COUNT} + 1))
fi
done
echo "Duplicate file count. SAME_COUNT = "${SAME_COUNT}