[X-Unix] find's -quit

Filipp Lepalaan filipp at mac.com
Sun Jun 3 10:06:17 PDT 2007


On 03.06.2007, at 18:13, Eric F Crist wrote:

> If you can give me a specific example of what you're searching for  
> and in what context, I can probably foo some sort of script  
> together that will do what you need.  Just a matter of piping the  
> right things together...

Thanks, Eric. This seems to do what I want:
find ~/Library/Mail | grep 210534.*emlx -m 1

The particular script searches for emails with a particular message  
ID. There may be tens of thousands of them so that's why I was so  
concerned about just quiting after the first match.

Just out of curiosity, what's the reason behind that particular  
command returning right after the first match (ie the grep  
effectively stopping find) while head -n 1 has to sit through the  
whole traversal?


-filipp




More information about the X-Unix mailing list