• BatmanAoD@programming.dev
    link
    fedilink
    arrow-up
    6
    ·
    1 day ago

    For interactive use, tab-completion essentially makes this a non-issue, because shells add escaping in the appropriate places.

    For scripting, where spaces are harder to deal with, unfortunately there’s just not much you can do; your two options are basically to learn all of your particular shell’s patterns for dealing with whitespace in filenames, or only write scripts in something other than a POSIX shell.

    • Luc@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      21 hours ago

      Scripting isn’t the issue, but for tab completion: the boundary is often at a space or parenthesis so that you need to type the backslash + char to continue tabbing to completion

      • BatmanAoD@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        12 hours ago

        Believe me, whitespace-correct scripting is absolutely an issue.

        You’re right that it’s annoying when filenames diverge right at a character that must be escaped.