# HG changeset patch # User edhoprima@gmail.com # Date 1246290028 0 # Node ID 30d2fb6560298f6466164213b66efa5c0682e6c4 # Parent 8efa600ebfdb57e1f65ebe8151a3d3422c403cd3 scrapping grep -vf diff -r 8efa600ebfdb -r 30d2fb656029 moefetch.sh --- a/moefetch.sh Mon Jun 29 15:29:08 2009 +0000 +++ b/moefetch.sh Mon Jun 29 15:40:28 2009 +0000 @@ -158,7 +158,7 @@ fi done [ "$(Count_Files "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}")" -eq 0 ] && ISNEW=1 - for i in error ok list newlist; do + for i in error ok list newlist templist; do touch "${TEMP_PREFIX}-${i}" || Fatal_Err "Error creating ${TEMP_PREFIX}-${i}. This shouldn't happen" done # @@ -232,7 +232,12 @@ #ls "../${TARGET_DIR}" | grep -vf "${TARGET_DIR}-error" > "${TARGET_DIR}-ok" # find "${BASE_DIR}/${SITE_DIR}/${TARGET_DIR}" | comm -1 -3 "${TEMP_PREFIX}-error" - | sed -e "${SED_GET_FILENAME}" > "${TEMP_PREFIX}-ok" - cat "${TEMP_PREFIX}-list" | grep -vf "${TEMP_PREFIX}-ok" > "${TEMP_PREFIX}-newlist" + cat "${TEMP_PREFIX}-list" > "${TEMP_PREFIX}-templist" + while read -r IS_OK; do + cat "${TEMP_PREFIX}-templist" | grep -v "${IS_OK}" > "${TEMP_PREFIX}-newlist" + cat "${TEMP_PREFIX}-newlist" > "${TEMP_PREFIX}-templist" + done < "${TEMP_PREFIX}-ok" + #cat "${TEMP_PREFIX}-list" | grep -vf "${TEMP_PREFIX}-ok" > "${TEMP_PREFIX}-newlist" echo "$(echo $(wc -l < "${TEMP_PREFIX}-newlist")) file(s) to be downloaded" else