‘Well it’s only passing mv a list of–’ yeah yeah yeah, I know, and that’s why I’m calling bullshit. It should be massively harder to execute filenames. Even if 1970s decisions make that the eternal hideous default: the lack of any idiot-proof standard workaround is incomprehensible.

StackOverflow’s full of competing one-liners and people pointing out how each one is considered harmful. The least-skeezy options use exec. That sentence should make anyone recoil in horror.

This is not a filename problem. This is a tool problem. If a single printable character is going to silently expand into a list of names, then for god’s sake, having it put each name in quotes should be fucking trivial.

  • @GenderNeutralBro
    link
    24 months ago

    This is exactly correct. This is why I say it would require a whole new OS with no regard for compatibility with current systems.

    As long as arguments are typeless and transmitted in a single array, there is no universal way to make programs distinguish between an option and file name that are identical. Full stop. No way. This has nothing to do with quoting schemes.

    There are conventions to work around this (like --) but that is at the command level, NOT the shell level. It is not universal.

    • @NeatNit@discuss.tchncs.de
      link
      fedilink
      14 months ago

      Okay, I pretty much agree with you in theory, but in practice you’re basically describing PowerShell which I just cannot. :P

      • @GenderNeutralBro
        link
        24 months ago

        LOL. Now I feel dirty.

        To be fair, there’s a lot that PowerShell does much better than Bash and similar shells. Piping tables as tables is rad.