Prune problems with find.
From: Ian Stirling (root_at_mauve.demon.co.uk)
Date: 12/13/04
- Next message: Heiner Steven: "Top 10 subjects comp.unix.questions"
- Previous message: Barry Margolin: "Re: Execute two processes ( fork() ) alternatively"
- Next in thread: Barry Margolin: "Re: Prune problems with find."
- Reply: Barry Margolin: "Re: Prune problems with find."
- Reply: Henrik S. Hansen: "Re: Prune problems with find."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 12 Dec 2004 23:49:10 GMT
I presume I'm doing something stupid, but I can't see it.
A test case.
$ find .
.
./1
./1/ls
./2
./2/ls
./3
./3/ls
./2o
./2o/ls
$ find . -type d -path ./2o
./2o
(as expected)
find . -type d -path ./2o -prune -o -print
.
./1
./1/ls
./2
./2/ls
./3
./3/ls
Huh?
Ok, it sort-of works, excluding path ./2o, but why do I get every
file listed.
And is listed highest in the precedence order, and surely if the LHS
(-type d) fails, the rest is not executed?
Any help gratefully accepted.
- Next message: Heiner Steven: "Top 10 subjects comp.unix.questions"
- Previous message: Barry Margolin: "Re: Execute two processes ( fork() ) alternatively"
- Next in thread: Barry Margolin: "Re: Prune problems with find."
- Reply: Barry Margolin: "Re: Prune problems with find."
- Reply: Henrik S. Hansen: "Re: Prune problems with find."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|