ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/bin/removeZeroLengthFiles.sh
(Generate patch)

Comparing UserCode/MitProd/Processing/bin/removeZeroLengthFiles.sh (file contents):
Revision 1.1 by paus, Sun Dec 5 01:01:21 2010 UTC vs.
Revision 1.4 by paus, Tue Feb 28 11:54:36 2012 UTC

# Line 1 | Line 1
1   #!/bin/bash
2  
3   DIR=$1
4 + if [ "$2" != "" ]
5 + then
6 +  PATTERN=$2
7 + else
8 +  PATTERN=root
9 + fi
10  
11   # Health checks
12   if [ ".$1" == "." ]
13   then
14    echo "";
15 <  echo "usage: $H  <sampleList>";
15 >  echo "usage: $0  <directory-list> [ <pattern> = root ] ";
16    echo ""
17    exit 1
18   fi
19  
20 < ls -1l $DIR | grep root | \
20 > list $DIR | grep $PATTERN | \
21   while read line
22   do
23 <  size=`echo $line | tr -s ' ' | cut -d ' ' -f 5`
24 <  file=`echo $line | tr -s ' ' | cut -d ' ' -f 9`
23 >
24 >  size=`echo $line | tr -s ' ' | cut -d ' ' -f 1`
25 >  file=`echo $line | tr -s ' ' | cut -d ' ' -f 2`
26    if [ "$size" == "0" ]
27    then
28      echo "File: delete $file with $size bytes"
29 <    rm $DIR/$file
23 <  #else
24 <  #  echo "File: -keep- $file with $size bytes"
29 >    remove --exe $DIR/$file
30    fi
31 +
32   done

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines