Only delete if DELETE != 0.
authorRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Fri, 1 May 2015 20:47:07 +0000 (13:47 -0700)
committerRobin H. Johnson <rjohnson@sitka.bclibraries.ca>
Fri, 1 May 2015 20:47:07 +0000 (13:47 -0700)
Signed-off-by: Robin H. Johnson <rjohnson@sitka.bclibraries.ca>
marc_export_custom/stats.sh

index 32018c4..17d2674 100755 (executable)
@@ -2,8 +2,8 @@
 basedir=$(readlink -f $(dirname $0))
 files=$(ls *.marc.bz2 *.marc 2>/dev/null |grep -v split |sed 's,\.bz2,,g' | sort | uniq)
 for i in $files; do 
-       s=$i.stats
-       j=$i.bz2
+       s=${i}.stats
+       j=${i}.bz2
        [ -f $s ] && continue
        echo === $i
        if [ -f $j -a ! -f $i ]; then
@@ -21,5 +21,5 @@ for i in $files; do
        ls -la $i $j | tee -a $s
        sha1sum $i $j | tee -a $s
        marcdump --stats --quiet --noprint $i | tee -a ${s}
-       rm -f $i
+       [ "$DELETE" != "0" ] && rm -f $i
 done