bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Interaction between -o and the default-print


From: James Youngman
Subject: Interaction between -o and the default-print
Date: Sun, 31 Oct 2004 13:19:45 +0000
User-agent: Mutt/1.3.28i

All,

The following is a summary of a bug report raised on the Debian bug
tracker for findutils
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=194160) :-


> according to the man-page and info, the expected output from the
> following find commands should be identical: 
> 
> myhost# ls -lRgoF
> .:
> total 4
> drwxr-xr-x    2     4096 May 21 12:51 b/
> -rw-r--r--    1        0 May 21 12:51 c
> 
> ./b:
> total 0
> -rw-r--r--    1        0 May 21 12:51 d
> myhost# find . -name b -prune -o -type f -print
> ./c
> myhost# find . -name b -prune -o -type f      # ABNORMAL
> ./b
> ./c
> myhost# find . \( -name b -prune \) -o \( -type f -print \)
> ./c


However, I don't think this is a bug, because "find xxx" is equivalent
to "find \( xxx \) -print" and not to "find xxx -print".  (This
statement applies if none of the actions in xxx include -print
anyway).

So, I think the second command in the above example should be
equvalent to "find . \( -name b -prune -o -type f \) -print", not to
the first command.   Viz :-

$ find . -ls
590608    4 drwxr-xr-x   3 james    users        4096 Oct 31 13:09 .
590749    4 drwxr-xr-x   2 james    users        4096 Oct 31 13:09 ./b
590748    0 -rw-r--r--   1 james    users           0 Oct 31 13:09 ./c
$ find . -name b -prune -o -type f -print
./c
$ find . -name b -prune -o -type f
./b
./c
$ find . \( -name b -prune -o -type f \) -print
./b
./c


I've sent this to bug-findutils for two reasons :-

a) Someone on the list may jump in and tell me they think I'm wrong.

b) The Debian BTS says that this problem was passed to upstream, which
   in all likelihood means this mailing list.  Hence this is a followup.

Regards,
James.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]