On 08/25/2011 06:46 PM, Peng Yu wrote:
Hi,
By default, find will look for all the matches. Is there a way to let
find only get the first match and then return?
find ... -print -quit
does your normal ... find, prints the first answer, then quits.
--
Eric Blake ebl...@redhat.com+1-801-34
Hi,
By default, find will look for all the matches. Is there a way to let
find only get the first match and then return?
--
Regards,
Peng
Follow-up Comment #3, bug #34083 (project findutils):
Just checked that such an option is not specified in POSIX (2004 or 2008) so
scripts trying to be portable should not use it anyway and use the sh -c
trick, for example. This is an argument for not implementing it and closing
the report.
_