[X-Unix] find's -quit

Filipp Lepalaan filipp at mac.com
Sun Jun 3 07:53:08 PDT 2007


On 03.06.2007, at 17:21, Scott Forbes wrote:

> On Jun 3, 2007, at 12:30 AM, Filipp Lepalaan wrote:
>
>> Hi gang,
>>
>> Just a quick question that kinda stumped me. How do you limit  
>> find's search results to just the first result?
>> GNU find has -quit (http://unixhelp.ed.ac.uk/CGI/man-cgi?find) but  
>> I can't seem to find any equivalent on OS X.
>>
>> This is for performance reasons so head is not an option.
>
> I don't see that option either, but if stuck you could get  
> findutils from DarwinPorts and use gfind:
>
> -> sudo port install findutils
> ...
> -> cd /opt/local/bin
> -> gfind -name 'g*' -print -quit
> ./qawk
> ->

Thanks for the info, Scott. Unfortunately this is for something that  
should run on anyone's Mac (it's actually a piece of a larger  
AppleScript utility).


-filipp



More information about the X-Unix mailing list