ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/Processing/bin/removeZeroLengthFiles.sh
Revision: 1.4
Committed: Tue Feb 28 11:54:36 2012 UTC (13 years, 2 months ago) by paus
Content type: application/x-sh
Branch: MAIN
CVS Tags: Mit_032, Mit_031, Mit_030, Mit_029c, Mit_029b, Mit_030_pre1, Mit_029a, Mit_029, Mit_029_pre1, Mit_028a, Mit_028, Mit_027a, Mit_027, Mit_026, Mit_025e, Mit_025d, HEAD
Changes since 1.3: +10 -2 lines
Log Message:
Last updates.

File Contents

# Content
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: $0 <directory-list> [ <pattern> = root ] ";
16 echo ""
17 exit 1
18 fi
19
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" ]
27 then
28 echo "File: delete $file with $size bytes"
29 remove --exe $DIR/$file
30 fi
31
32 done