Re: [bug #61774] Docs for find -delete out of sync

admin4 <[email protected]>
Newsgroups gmane.comp.gnu.findutils.bugs
Message-ID <[email protected]>
Hello,

updating the manpage sounds good, but maybe find also needs an 
update/patch, as it (imho) does not work correctly (with the find . 
-delete) as intended?

# warning! this can ruin one's day

mkdir temp
cd temp
touch 1 2 3 f25020672.avi

# only finds that file
find . -name "*f25020672.avi*"
./f25020672.avi

# DANGER! THIS DELETES ALL (!!!) FILES IN THE CURRENT DIRECTORY! (NOT ONLY THE -name “*FILES*” SPECIFIED )
find . -delete -name "*f25020672.avi*" <- why does it do that? it is like it completely ignores anything after -delete X-D (and just deletes everything in the current dir)

# this would have been the correct way to do it
find . -name "*f25020672.avi*" -delete

https://dwaves.de/2021/12/20/be-careful-with-find-delete-find-delete-name-vs-find-name-delete/

On 1/31/22 00:57, Bernhard Voelker wrote:
> Update of bug #61774 (project findutils):
>
>                    Status:                    None => Code Review
>               Assigned to:                    None => berny
>             Fixed Release:                    None => 4.9.0
>
>      _______________________________________________________
>
> Follow-up Comment #1:
>
> Thanks for the report and the suggested patch.
>
> The formatting for the Texinfo changes were not ideal
> (e.g. it is better to use a "@quotation" environment for
> a warning block.
>
> Also "Because -delete implies @samp{-delete}, ..." was obviously wrong.
>
> I tried further to improve and unify the -delete description
> in the attached git patch.
> Okay to push in your name?
>
> Thanks & have a nice day,
> Berny
>
> (file #52778)
>      _______________________________________________________
>
> Additional Item Attachment:
>
> File name: 0001-doc-improve-description-of-find-delete.patch Size:5 KB
>     
> <https://file.savannah.gnu.org/file/0001-doc-improve-description-of-find-delete.patch?file_id=52778>
>
>
>
>      _______________________________________________________
>
> Reply to this item at:
>
>    <https://savannah.gnu.org/bugs/?61774>
>
> _______________________________________________
>    Message sent via Savannah
>    https://savannah.gnu.org/
>
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.