# HG changeset patch # User Edho Arief # Date 1321806079 -25200 # Node ID d7e5a2e70cf36642e2f03c01dc62a2d0cae45762 # Parent 4a8d81743728de433e682f9a0e781faa7c05d0b3 Proper test for for loop (*, .*) diff -r 4a8d81743728 -r d7e5a2e70cf3 bin/moefetch.sh --- a/bin/moefetch.sh Tue Nov 08 22:31:10 2011 +0700 +++ b/bin/moefetch.sh Sun Nov 20 23:21:19 2011 +0700 @@ -161,7 +161,7 @@ Count_Files() { numfiles=0 for dircontent in "${*}/"* "${*}/".*; do - if [ "${dircontent}" != "${*}/*" ] || [ -e "${dircontent}" ]; then + if [ -e "${dircontent}" ] && [ x"${dircontent}" != x"${*}/." ] && [ x"${dircontent}" != x"${*}/.." ]; then numfiles=$((numfiles + 1)) fi done @@ -243,7 +243,7 @@ > "${TEMP_PREFIX}-ok" for file in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"* do - if [ "${file}" != "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/*" ]; then + if [ -e "${file}" ]; then if [ -n "$(is_not_md5 "${file}")" ] || [ -d "${file}" ]; then files_notdanbooru="${files_notdanbooru} $(get_basename "${file}")"