On Tue, 9 Jan 2001, Dallman Ross wrote:
Bennett Todd <bet(_at_)rahul(_dot_)net> wrote:
find renamed-maildir/{new,cur} -maxdepth 1 -type f | \
while read f;do procmail <$f; done
What's the advantage of this over, say,
d=renamed-maildir/{new,cur}
find $d -maxdepth 1 -type f -exec procmail < {} \;
None... They are equal...
But remember that you need to escape { and } aswell when you run bash...
The while loop wins the contest however when you want to do more things:
find dir -maxdepth 1 -type f | while read f;do
echo 'Current file is: '"$f"
case "$f" in
*.gz|*.z) gzip -dc "$f" | procmail;;
*) procmail < "$f";;
esac
done
But simply put the cpu/memory used are equal so it's up to the individual
what they use.
(I generally go for the while loop when redirections shall be done,
though.)
--
I guess I've been so wrapped up in playing the game that I never took
time enough to figure out where the goal line was -- what it meant to
win -- or even how you won.
-- Cash McCall
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail