I know that there are ten different alternatives. Why don’t we simply improve the basic stuff?

  • taladar
    link
    fedilink
    arrow-up
    3
    ·
    edit-2
    7 months ago

    Every single command, option and argument in the shell is split by spaces, regardless of what it contains. That is clearly the more common case. I am not talking about splitting when the space comes out of a variable but in general, as part of the syntax.

    I am well aware of how quoting works to avoid accidental splitting and it is an absolute non-issue in practice once you get used to quoting things, about as annoying as the fact that you have to quote strings in every other programming language, i.e. not at all.

    • gnuhaut@lemmy.ml
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      7 months ago

      Ah that’s your point. Yeah I agree that splitting literal a b c is convenient. It is surprising to many (like here) that this happens after variable substitution, and that’s not very convenient since you almost never want that. You could define this to happen the other way around, but then you’d obviously have to invent a new syntax for explicit splitting, which would be its own kind of annoying.

      Edit: YSH (oil) does that btw. See here.