[wplug] Interesting shell problem (possibly OT?)

Nathan Embery nembery at met-net.com
Tue Jan 11 09:04:26 EST 2011


On Mon, 2011-01-10 at 22:23 -0500, Christopher DeMarco wrote:
> On 06 Jan 2011, at 12:09 PM, Nathan Embery wrote:
> 
> > a script that passes a huge list of files to grep for processing
> > then deletes them if necessary. Pretty basic stuff.
> 
> rm -vf $(grep -lr "Major Fault: AIS") | wc -l
> 

It never occurred to me to use the -v option on rm to pass to wc. Nice!

Now try it in a way that tracks both the number of files examined and
the number deleted ;-)

> Or was the question less about brevity and more about YTF it happened?
> 
> 

As an update to the YTF question, I disabled the largest mailbox so that
it would not receive any new mails and the script happily ran for over
4.5 hours deleting nearly 1.2 million files. Since then I've been trying
in vain to recreate the problem. I even loaded a directory with about 1
million files each full of random data and this script had no problems
whatsoever. So, I'm guessing the issue wasn't so much of a shell
limitation or find issue, but more than likely something in particular
with postfix. 


-Nate



More information about the wplug mailing list