comparison moefetch.sh @ 190:1061a214a1f1

thanks to folks at #bash!
author edhoprima@gmail.com <edhoprima@gmail.com>
date Sun, 28 Jun 2009 14:07:53 +0000
parents 04841244beae
children a4ceb952b05a
comparison
equal deleted inserted replaced
189:04841244beae 190:1061a214a1f1
152 152
153 # current dir: ${BASE_DIR}/${SITE_DIR}/${TARGET_DIR} 153 # current dir: ${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}
154 echo "Cleaning up repository folder..." 154 echo "Cleaning up repository folder..."
155 TRASH_DIR="${SITE_DIR}-${TARGET_DIR}-`date -u +%Y%m%d-%H.%M`" 155 TRASH_DIR="${SITE_DIR}-${TARGET_DIR}-`date -u +%Y%m%d-%H.%M`"
156 mkdir -p "${BASE_DIR}/trash/${TRASH_DIR}" || Err_Fatal "Unable to create trash folder" 156 mkdir -p "${BASE_DIR}/trash/${TRASH_DIR}" || Err_Fatal "Unable to create trash folder"
157 for TRASH in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/*" 157 for TRASH in "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}/"*
158 do 158 do
159 echo "$TRASH"
160 ISTRASH= 159 ISTRASH=
161 if [ -d "${TRASH}" ]; then 160 if [ -d "${TRASH}" ]; then
162 ISTRASH=1 161 ISTRASH=1
163 else 162 else
164 [ "`echo \"${FILE}\" | sed -e 's/.*\/\([\^\/]*\)/\1/g;s/\([0-9a-f]\{32\}.*\)//g' | grep -v ^$`" ] && ISTRASH=1 163 [ "`echo \"${FILE}\" | sed -e 's/.*\/\([\^\/]*\)/\1/g;s/\([0-9a-f]\{32\}.*\)//g' | grep -v ^$`" ] && ISTRASH=1