Bug 190633 - odd -print behaviour
Summary: odd -print behaviour
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: findutils
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Miloslav Trmač
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-05-04 05:49 UTC by Dave Jones
Modified: 2015-01-04 22:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-05-05 15:29:46 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Dave Jones 2006-05-04 05:49:23 UTC
Is this expected behaviour ? It seems odd to me.

(01:47:44:davej@nwo:tmp)$ touch a.c
(01:47:47:davej@nwo:tmp)$ touch a.h
(01:47:48:davej@nwo:tmp)$ ls *.c *.h
a.c  a.h
(01:47:52:davej@nwo:tmp)$ find . -name "*.c" -o -name "*.h"
./a.c
./a.h
(01:48:04:davej@nwo:tmp)$ find . -name "*.c" -o -name "*.h" -print
./a.h
(01:48:06:davej@nwo:tmp)$

Comment 1 Miloslav Trmač 2006-05-05 15:29:46 UTC
Yes, that's correct:
    find . -name "*.c" -o -name "*.h"
is equivalent to
    find . \( -name "*.c" -o -name "*.h" \) -print
OTOH
    find . -name "*.c" -o -name "*.h" -print
is
    find . -name "*.c" -o -name "*.h" -a -print
which is
    find . -name "*.c" -o \( -name "*.h" -a -print \)




Note You need to log in before you can comment on or make changes to this bug.