stonegray 2 days ago

Is the full path guaranteed? For example homebrew, snap, and apt might put it all in different places. $PATH is a useful tool.

  • pasc1878 2 days ago

    But not in this case where you have two executables with the same name.

    You have to know where the tool was installed or else be certain no other sl is on your path.

  • [removed] 2 days ago
    [deleted]
Joker_vD 2 days ago

How would knowing the full path help you anyway? It's either in "/usr/bin/sl", or "/usr/local/bin", or "~/.local/bin", now what?

By the way, believe it or not, POSIX compliance requires existence of only two directories (/dev and /tmp) and three files (/dev/console, /dev/null, and /dev/tty) on the system; everything else is completely optional, including existence of /bin, /etc, and /usr.

  • pasc1878 a day ago

    Because you know what you installed and so which sl to use.

    • Joker_vD a day ago

      But the sl is not invoked by you. It is invoked by some npm module (a 5-times-removed dependency from any side) which hopes that either there is "sl" in the $PATH and it is the Sapling CLI, or there is no "sl" in the $PATH. This module can't use absolute paths because it does not know how the end user's system looks.

      • pasc1878 17 hours ago

        In that case it is a large security risk as well as it does not work as per the article

skipants 2 days ago

What if the full path is just `/usr/bin/sl`?

  • pasc1878 2 days ago

    Then yopu get the sl there which could be correct.

charcircuit 2 days ago

Finding the full path of sl requires looking at $PATH

  • pasc1878 2 days ago

    In this case not as then you find the wrong sl - you need to know where the correct sl was installed.