This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: possible problem with "find . -name blah -o -name blah2"
- From: Andrey Repin <anrdaemon at yandex dot ru>
- To: mlist at bogusville dot us, cygwin at cygwin dot com
- Date: Thu, 21 Aug 2014 02:45:55 +0400
- Subject: Re: possible problem with "find . -name blah -o -name blah2"
- Authentication-results: sourceware.org; auth=none
- References: <8d384135fd838eaef07b4eb66ab60cae dot squirrel at bogusville dot us>
- Reply-to: cygwin at cygwin dot com
Greetings, mlist@bogusville.us!
> using CYGWIN_NT-6.1, bash 4.1.11(2) and find 4.5.12, the following returns
> immediately
> find . -name \*.cs -o -name \*.h -o -name \*.cpp -exec ls {} \;
> pick your favorite for 'ls'
$ uname -a
CYGWIN_NT-5.1 daemon2 1.7.32s(0.274/5/3) 20140807 16:26:58 i686 Cygwin
$ find . -name \*.cs -o -name \*.h -o -name \*.cpp -exec ls {} \;
./farmanager-read-only/enc/enc_rus/meta/articles/panel/panelplugin.1/desktop.cpp
./farmanager-read-only/enc/enc_rus/meta/articles/panel/panelplugin.1/main.cpp
./farmanager-read-only/enc/enc_rus/meta/articles/panel/panelplugin.1/mix.cpp
./farmanager-read-only/misc/fexcept/execdump/ExcDump.cpp
./farmanager-read-only/misc/fexcept/execdump/test/test.cpp
./farmanager-read-only/misc/fexcept/execdump/xxlib/Std/2asm.cpp
> this works as expected
> find . -name \*.cs -o -name \*.h -o -name \*.cpp
> it's probably not a horrible problem but i thought i'd report it.
Can't seems to replicate it on my setup. Do you use 64-bit Cygwin?
Discussion aside, please use -execdir rather than -exec to avoid race
conditions in a time gap between find's decision to run something and
actually running that something.
--
WBR,
Andrey Repin (anrdaemon@yandex.ru) 21.08.2014, <02:39>
Sorry for my terrible english...
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple