public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* possible problem with "find . -name blah -o -name blah2"
@ 2014-08-20 20:58 mlist
  2014-08-20 21:08 ` Georg Nikodym
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mlist @ 2014-08-20 20:58 UTC (permalink / raw)
  To: cygwin

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'

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.

   bo

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: possible problem with "find . -name blah -o -name blah2"
  2014-08-20 20:58 possible problem with "find . -name blah -o -name blah2" mlist
@ 2014-08-20 21:08 ` Georg Nikodym
  2014-08-20 22:50 ` Andrey Repin
  2014-08-21 12:15 ` Eric Blake
  2 siblings, 0 replies; 4+ messages in thread
From: Georg Nikodym @ 2014-08-20 21:08 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 325 bytes --]


On Aug 20, 2014, at 16:58 , mlist@bogusville.us wrote:

> 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 {} \;

Not a Cygwin problem.  Try:

	find . \( -name \*.cs -o -name \*.h -o -name \*.cpp \) -exec ls {} \;

-g


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 155 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: possible problem with "find . -name blah -o -name blah2"
  2014-08-20 20:58 possible problem with "find . -name blah -o -name blah2" mlist
  2014-08-20 21:08 ` Georg Nikodym
@ 2014-08-20 22:50 ` Andrey Repin
  2014-08-21 12:15 ` Eric Blake
  2 siblings, 0 replies; 4+ messages in thread
From: Andrey Repin @ 2014-08-20 22:50 UTC (permalink / raw)
  To: mlist, cygwin

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: possible problem with "find . -name blah -o -name blah2"
  2014-08-20 20:58 possible problem with "find . -name blah -o -name blah2" mlist
  2014-08-20 21:08 ` Georg Nikodym
  2014-08-20 22:50 ` Andrey Repin
@ 2014-08-21 12:15 ` Eric Blake
  2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2014-08-21 12:15 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

On 08/20/2014 02:58 PM, mlist@bogusville.us wrote:
> 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 {} \;

This parses as:
find . -name \*.cs -o -name \*.h -o \( -name \*.cpp -exec ls {} \; \)

> 
> pick your favorite for 'ls'
> 
> this works as expected
> 
>    find . -name \*.cs -o -name \*.h -o -name \*.cpp

This parses as:
find . \( -name \*.cs -o -name \*.h -o -name \*.cpp \) -print

> 
> it's probably not a horrible problem but i thought i'd report it.

Not a bug.  Same POSIX-mandated behavior on all platforms.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-08-21 12:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-20 20:58 possible problem with "find . -name blah -o -name blah2" mlist
2014-08-20 21:08 ` Georg Nikodym
2014-08-20 22:50 ` Andrey Repin
2014-08-21 12:15 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).