On Wed, Feb 12, 2025, at 2:02 PM, Andrés Rodríguez Reina wrote:
> And I also 
> agree that any other substitution is subject to cause the same 
> confusion, but the case with the tilde expansion produces more damage 
> to inexperienced users. I mean: "rm -rf *" just deletes the whole 
> folder contents, while "rm -rf ~" deletes all your files (similarly 
> with other destructive commands).

Depending on the current working directory, "rm -rf *" could easily
be more catastrophic than "rm -rf ~".

> For example: "rm -rf /" is also unambiguous, yet the command warns you 
> about the possible unintended consequences.
>
> In any case, I'd say that in interactive mode and with a specific flag 
> active, I could find useful that no command with a $name/*/~/etc is 
> executed when a file by the same name is present at the current 
> directory.

It's one thing for a command that knows its own destructiveness to
warn about that.  It's another for the shell itself to do a bunch
of I/O before even beginning to process a command that might end
up being benign.

> Advanced users can easily disable the flag and obtain full 
> power/risk.

I'm not sure this would fly as the new default.

-- 
vq

  • [S... Andrés Rodríguez Reina
    • ... Lawrence Velázquez
      • ... Andrés Rodríguez Reina
        • ... Lawrence Velázquez
    • ... microsuxx
      • ... microsuxx
        • ... Andrés Rodríguez Reina via Bug reports for the GNU Bourne Again SHell
    • ... Dale R. Worley
    • ... Chet Ramey

Reply via email to