Follow-up Comment #6, bug #65895 (group findutils): [comment #5 comment #5:] > Sorry I didn't make myself clear enough. I wasn't suggesting that "find . -delete" stop working. I was suggesting that it become an error for -delete to be followed by one or more pure predicate options (e.g. -name) but no side-effect options (e.g. -exec).
I like that idea, so I added it in bfs 4.0 (https://github.com/tavianator/bfs/releases/tag/4.0) $ bfs -delete -name a bfs: warning: bfs -delete -name a bfs: warning: ~~~~~~~ bfs: warning: The result of this expression is ignored. bfs: warning: Do you want to continue? n > It's not the same thing, since such commands would never have been intentional or valid. Even if someone did want to delete all files and list a subset of them (for example), they would find that that didn't work, presumably because the files are deleted before their names are checked That's not why; the real reason is that any action (like `-delete`) suppresses the implicit `-print` action. If you add it back explicitly you'll get what you expected: $ find -delete -name a -print ./a Though it is very fragile to do much with a deleted file: $ find -delete -name a -links +0 -print find: ‘./a’: No such file or directory _______________________________________________________ Reply to this item at: <https://savannah.gnu.org/bugs/?65895> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
signature.asc
Description: PGP signature