On 11/16/09, LuKreme <kremels(_at_)kreme(_dot_)com> wrote:
On 16-Nov-2009, at 01:11, JW Simpson wrote:
beforehand to be large enough.
> 6. Why are you using echo for a null string ???
Because I don't know the syntax in bash for 'if file is zero length' or 'if
NOT (file exists and size is greater than zero) and trying to leave an empty ;
: is bash's null builtin
there caused an error. I kept meaning to look this up, but it's proved
difficult to find and I moved on to other things.
[ -s $F ] || rm $F
or
[ ! -s $F ] && rm $F
> 7. You don't even need the if statement. You can use "rm
> -f /tmp/$UNAME.$DATE.$i", and eliminate 4 lines of code altogether.
No, because I am only removing the files that are zero length.
my bad ...
The other file I am counting the number of lines with wc. (I am removing them
so I don't end up with a list of every mailbox in every mail, most showing a
'0' for the count).
The logic is if the files in non-zero length, do nothing (echo -n) otherwise
(if the file IS zero length), delete it. the files that are left, get
processed by wc -l.
find -size 0 -delete
--
John Wesley Simpson
SwaJime's Cove℠
www.swajime.com
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)de
http://mailman.rwth-aachen.de/mailman/listinfo/procmail