Don't Put Tilde In Your Path

(disconnect3d.pl)

42 points | by arusekk 1 hour ago

6 comments

  • amarshall 4 minutes ago
    Or you can just…not quote the tilde. Folks always seem to reflexively quote “strings” in Bash while not realizing that (almost) everything is a string and most strings are not quoted and it would be odd to do it (e.g. no one is doing `"ls" "-a" "foo"`).
  • FeepingCreature 16 minutes ago
    Kind of seems like you should have noticed this by your ~/.local/bin PATH not working?
  • gjvc 14 minutes ago
    bad example in the article:

      export PATH="$PATH:$HOME/.local/bin/"
    
    better:

      export PATH="$HOME/.local/bin/:$PATH"
  • IshKebab 52 minutes ago
    Bash footgun #238503.
    • _ZeD_ 27 minutes ago
      well.. it's in zsh (and probably any other *sh) too
      • vbernat 2 minutes ago
        In Zsh, you can set PATH with path=(~/.local/bin $path). There, it works as shell expansion works.
  • hnd9q09qk4 26 minutes ago
    [flagged]
  • mr_mitm 7 minutes ago
    So many headaches could be avoided if we only allowed `[A-Za-z0-9._-]` in paths. (Arguably, even `-` can be problematic.) Encoding issues, expansion, parameter separation, ... and I never saw a convincing case in favor of supporting anything else.
    • jetbalsa 4 minutes ago
      What about people who do not speak English? or even use Latin letters?
      • ThunderSizzle 1 minute ago
        What Latin letter(s) are you referring to?

        The (classical) Latin alphabet can be fully described by the English alphabet.