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.3 by paus, Thu Oct 20 23:16:23 2011 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  <directory-list>";
15 >  echo "usage: $0  <directory-list> [ <pattern> = root ] ";
16    echo ""
17    exit 1
18   fi
19  
20 < list $DIR | grep root | \
20 > list $DIR | grep $PATTERN | \
21   while read line
22   do
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" ]
# Line 21 | Line 28 | do
28      echo "File: delete $file with $size bytes"
29      remove --exe $DIR/$file
30    fi
31 +
32   done

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines