4 ms·
it is be better for the program to amend path for itself to include both paths. Or probe for its location Rather than hardcore one or the other
by zaphirplane 5y ago
it is be better for the program to amend path for itself to include both paths.
Or probe for its location
Rather than hardcore one or the other
- Dylan16807 5y agoHardcoding two locations is only marginally better than hardcoding one. (By probe I assume you mean probing a hardcoded list rather than something even more fragile and confusing.)
- zaphirplane 5y agoWhy ? If it’s in the path use that, else if in /sbin use that else in /bin use that Everyone happy
- usrbinbash 5y agoUntil it suddenly isn't in either of these paths, maybe because its required to run in some quirky setup. Hrdcoded paths for things a program doesn't bring with itself, should be avoided in general. There is a reason $PATH exists and is easily extended. It is the users/admins responsibility to make sure envvars are set correctly, and it's the programs responsibility to give a useful error message when it cannot locate the programs it expects in $PATH