diff moefetch.sh @ 169:b9a49b36e4ab

fix: mv fails for folder
author edhoprima@gmail.com <edhoprima@gmail.com>
date Fri, 05 Jun 2009 19:43:23 +0000
parents 2781576c06a5
children 0d385f77bb24
line wrap: on
line diff
--- a/moefetch.sh	Fri Jun 05 19:31:19 2009 +0000
+++ b/moefetch.sh	Fri Jun 05 19:43:23 2009 +0000
@@ -145,13 +145,13 @@
 		cd "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}"
 		for TRASH in `ls * | sed -e 's/\([0-9a-f]\{32\}.*\)//g' | grep -v ^$`
 		do
-			mv -f "${TRASH}" "${BASE_DIR}/trash"
+			mv -f "${BASE_DIR}/${SITE_DIR}/${TRASH}" "${BASE_DIR}/trash"
 			echo "Moved ${TRASH} to ${BASE_DIR}/trash"
 		done
 		printf "" > "${BASE_DIR}/temp/${SITE_DIR}-${TARGET_DIR}-error"
 		for FILE in *
 		do
-			if [ `${MD5} "${FILE}" | cut -d ' ' -f1 -` != `echo "${FILE}" | cut -d '.' -f1` ]
+			if [ "`${MD5} "${FILE}" | cut -d ' ' -f1 -` != `echo "${FILE}" | cut -d '.' -f1`" ]
 			then
 				echo
 				echo "${FILE}" >> "${BASE_DIR}/temp/${SITE_DIR}-${TARGET_DIR}-error"