bug-findutils
[Top][All Lists]
Advanced

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

Re: The returned value of -prune and its documentation


From: Cristian Zoicas
Subject: Re: The returned value of -prune and its documentation
Date: Thu, 2 May 2019 09:30:06 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.2



Dale R. Worley wrote:
Cristian Zoicas <address@hidden> writes:
The following directory structure and the following statement show that -prune
does not return false when -depth is given.

mkdir -p test/s_files/
echo a-top > test/a-top.txt
echo s-top > test/s-top.txt
echo a > test/s_files/a.txt
echo s1 > test/s_files/s1.txt
echo s2 > test/s_files/s2.txt

Or to make it much clearer:
     test/
         a-top.txt
         s-top.txt
         s_files/
             a.txt
             s1.txt
             s2.txt
find ./test/ -depth \( -name s\* -a -prune -a -printf "printed with printf: 
%p\n" \) -o -exec bash -c 'echo printed with echo: {}' ';

It seems to me that a much simpler test case that exercises the same
logic is:

     find ./test/ -depth -prune -print

excelent example :)


What version of find are you running?

(I am running 4.5.11, which is quite old.  But indeed, the above command
runs for me as if -prune returns true.)


Currently I use the following two configurations (find/os versions):



---- BEGIN find/OS version: configuration 1 ----

$ find -version
find (GNU findutils) 4.7.0-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.

Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) 
CBO(level=2)

$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 9.8 (stretch)
Release:        9.8
Codename:       stretch

---- END find/OS version: configuration 1 ----




---- BEGIN find/OS version: configuration 2 ----

$ find -version
find (GNU findutils) 4.4.2
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS() 
CBO(level=0)


$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.10 (jessie)
Release:        8.10
Codename:       jessie


---- END find/OS version: configuration 2 ----




Dale




reply via email to

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