comparison moefetch.sh @ 156:d3b002fd944e

fix: my attempt at speeding up things failed. reverting back to trusty grep -vf
author edhoprima
date Sat, 25 Apr 2009 16:16:50 +0000
parents 78ef726d3845
children ffca564daefa
comparison
equal deleted inserted replaced
155:78ef726d3845 156:d3b002fd944e
79 echo "$totalerr file(s) error" 79 echo "$totalerr file(s) error"
80 80
81 echo "Generating list of new files..." 81 echo "Generating list of new files..."
82 # THE FILES 82 # THE FILES
83 #ls "../$outdir" | grep -vf "$outdir-error" > "$outdir-ok" 83 #ls "../$outdir" | grep -vf "$outdir-error" > "$outdir-ok"
84 #cat "$outdir-list" | grep -vf "$outdir-ok" > "$outdir-newlist" 84 #
85 ls "../$outdir" | comm -1 -2 "$outdir-error" - > "$outdir-ok" 85 ls "../$outdir" | comm -1 -2 "$outdir-error" - > "$outdir-ok"
86 comm -1 -2 "$outdir-list" "$outdir-error" > "$outdir-newlist" 86 cat "$outdir-list" | grep -vf "$outdir-ok" > "$outdir-newlist"
87 echo "`echo \`wc -l < \"$outdir-newlist\"\`` file(s) to be downloaded" 87 echo "`echo \`wc -l < \"$outdir-newlist\"\`` file(s) to be downloaded"
88 cd "../$outdir" 88 cd "../$outdir"
89 89
90 echo "Removing error files" 90 echo "Removing error files"
91 if [ $totalerr -eq 0 ]; then 91 if [ $totalerr -eq 0 ]; then
92 echo "No error file. 0 file removed" 92 echo "No error file. 0 file removed"
93 elif [ $totalerr -gt 0 ]; then 93 else
94 cat "../temp/$outdir-error" | xargs rm 94 cat "../temp/$outdir-error" | xargs rm
95 echo "$totalerr file(s) removed" 95 echo "$totalerr file(s) removed"
96 fi 96 fi
97 echo "`echo \`ls | wc -l\`` file(s) available locally" 97 echo "`echo \`ls | wc -l\`` file(s) available locally"
98 cd ../temp 98 cd ../temp
99 else 99 else
100 if [ $ISQUICK -eq 1 ]; then 100 if [ $ISQUICK -eq 1 ]; then