Mercurial > ec-dotfiles
comparison 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 |
comparison
equal
deleted
inserted
replaced
168:2781576c06a5 | 169:b9a49b36e4ab |
---|---|
143 | 143 |
144 # current dir: ${BASE_DIR}/${SITE_DIR}/${TARGET_DIR} | 144 # current dir: ${BASE_DIR}/${SITE_DIR}/${TARGET_DIR} |
145 cd "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}" | 145 cd "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}" |
146 for TRASH in `ls * | sed -e 's/\([0-9a-f]\{32\}.*\)//g' | grep -v ^$` | 146 for TRASH in `ls * | sed -e 's/\([0-9a-f]\{32\}.*\)//g' | grep -v ^$` |
147 do | 147 do |
148 mv -f "${TRASH}" "${BASE_DIR}/trash" | 148 mv -f "${BASE_DIR}/${SITE_DIR}/${TRASH}" "${BASE_DIR}/trash" |
149 echo "Moved ${TRASH} to ${BASE_DIR}/trash" | 149 echo "Moved ${TRASH} to ${BASE_DIR}/trash" |
150 done | 150 done |
151 printf "" > "${BASE_DIR}/temp/${SITE_DIR}-${TARGET_DIR}-error" | 151 printf "" > "${BASE_DIR}/temp/${SITE_DIR}-${TARGET_DIR}-error" |
152 for FILE in * | 152 for FILE in * |
153 do | 153 do |
154 if [ `${MD5} "${FILE}" | cut -d ' ' -f1 -` != `echo "${FILE}" | cut -d '.' -f1` ] | 154 if [ "`${MD5} "${FILE}" | cut -d ' ' -f1 -` != `echo "${FILE}" | cut -d '.' -f1`" ] |
155 then | 155 then |
156 echo | 156 echo |
157 echo "${FILE}" >> "${BASE_DIR}/temp/${SITE_DIR}-${TARGET_DIR}-error" | 157 echo "${FILE}" >> "${BASE_DIR}/temp/${SITE_DIR}-${TARGET_DIR}-error" |
158 echo "Error: ${FILE}" | 158 echo "Error: ${FILE}" |
159 fi | 159 fi |