• SavvyWolf@pawb.social
    link
    fedilink
    English
    arrow-up
    16
    ·
    5 days ago

    It’s actually harder to detect that. The * is expanded before the arguments are sent to rm, so it just sees a list of directories like /bin /usr /dev /sbin /home and so on.

    You could implement logic to detect that case, but at that point you’re just playing whackamole.

    • zea@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      5 days ago

      I believe zsh catches this and makes you confirm.

      Well, that or one of my plugins, I’m not sure.