[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #34159] -path and -prune with -print and without have different res
From: |
Eric Blake |
Subject: |
[bug #34159] -path and -prune with -print and without have different result. |
Date: |
Mon, 29 Aug 2011 13:18:23 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.20) Gecko/20110816 Fedora/3.6.20-1.fc14 Firefox/3.6.20 |
Update of bug #34159 (project findutils):
Status: None => Invalid
Assigned to: None => ericb
Open/Closed: Open => Closed
_______________________________________________________
Follow-up Comment #2:
Not a bug. -prune is documented as only having an action on directories, not
regular files - so -prune does not trim files.
$ find . -path '*/file' -prune -o -type f
is strictly equivalent to:
$ find . ( -path '*/file' -prune -o -type f ) -print
-path '*/file' is true for dir/file, -prune is always true but has no effect,
so the -o does not kick in, then the implicit -print prints the file name.
Meanwhile:
$ find . -path '*/file' -prune -o -type f -print
is strictly equivalent to:
$ find . ( -path '*/file' -prune ) -o ( -type f -print )
-path '*/file' is true, -prune is true and has no effect, so the -o does not
kick in, and there is nothing left to -print the file name.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?34159>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/