Tue 02 Aug 2016 10:07:42 PM UTC, original submission:
I am running versions from the Debian sid repositories.
$ apt show findutils
Package: findutils
Version: 4.6.0+git+20160703-2
$ find --version
find (GNU findutils) 4.7.0-git
I was attempting to clean multiple project directories with the same command, effectively `rm -r` triggered by the presence of a certain file.
The `find` command will print a "no such file or directory" error when a directory is removed while the command is running. Repro:
$ ls
$ mkdir -p a/b/c
$ touch a/b/test
$ ls -R
.:
a
./a:
b
./a/b:
c test
./a/b/c:
$ find . -type f -name test -execdir rm -r c \;
find: ā./a/b/cā: No such file or directory
$ echo $?
1
$ ls -R
.:
a
./a:
b
./a/b:
test
Expected behavior is identical results but no error, like in GNU find 4.4.2 on Ubuntu.
Moreover, this error persists even in the presence of `-prune`, which strikes me as unintuitive.
$ find . -type d -name c -prune -o -type f -name test -execdir rm -r c \;
find: ā./a/b/cā: No such file or directory
|