‘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.

  • NeatNit
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    9 months ago

    Can you run printf %s\\n *.jpg in that same directory and share the result? I’m really intrigued. If there’s private information in there, I’d be satisfied with just a handful of lines showing the issue with private info replaced with ****s

    Edit: also run alias mv to check whether you have an alias messing things up

    • mindbleach@sh.itjust.worksOP
      link
      fedilink
      arrow-up
      2
      ·
      9 months ago

      bash: alias: mv: not found

      printf %s\\n *.jpg is just a list of filenames on newlines. There’s 75,000 of them. You’ll have to take my word for it.

      Fortunately, GenderNeutralBro’s aside about using ./* instead of * works as expected. Could have been files beginning with _-. None begin with -, exactly.