* Sandro Tosi <mo...@debian.org>, 2014-02-28, 19:49:
| find . -name __pycache__ -exec rm -rf {} \;
| find: `./dot/pygraph/__pycache__': No such file or directory
[...]
this is really weird! it seems that find is able to find the
directories
Here's a minimal way to reproduce the problem:
$ mkdir __pycache__
$ find . -name __pycache__ -exec rm -rf {} \;
find: ‘./__pycache__’: No such file or directory
The trouble is that is that find tries to descend to the directory that
has just been deleted, which of course doesn't work. Appending -prune to
the find command-line fixes the problem:
$ mkdir __pycache__
$ find . -name __pycache__ -exec rm -rf {} \; -prune
$ echo $?
0
--
Jakub Wilk
--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org