bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fwd: Bug: rm -rf /*/*


From: Lawrence Velázquez
Subject: Re: Fwd: Bug: rm -rf /*/*
Date: Tue, 30 Nov 2021 20:01:24 -0500
User-agent: Cyrus-JMAP/3.5.0-alpha0-4410-g5528bb82a8-fm-20211130.003-g5528bb82

On Tue, Nov 30, 2021, at 6:34 PM, Chet Ramey wrote:
> On 11/30/21 3:53 PM, Robert Swinford wrote:
>> (and globbing in zsh evals /*/* to //):
>
> Why? Under what circumstances is that correct?

I assume that OP is incorrectly describing zsh's default behavior
of intercepting risky ''rm'' commands and interactively requesting
confirmation.

    $ zsh -f
    % rm -rf /*/*
    zsh: sure you want to delete all the files in /* [yn]?

This behavior is specific to ''rm'' and can be disabled [*].  In
other contexts, zsh expands ''/*/*'' more or less as usual.  This
can be verified trivially.

    $ zsh -fc 'print -rC1 -- /*/*'

[*]: https://zsh.sourceforge.io/Doc/Release/Options.html#index-RMSTARSILENT

-- 
vq



reply via email to

[Prev in Thread] Current Thread [Next in Thread]