Directories sequence in default "path" variable

Hello,

I noticed that in the default sequence of "path" directories /usr/local/sbin and /usr/local/bin come at the very end:

Code:
root@egeo [~] > egrep path /etc/login.conf | egrep -v "^#"
	:path=/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin ~/bin:\

In my opinion, this limits the flexibility for those third part applications that want to install customized versions of certain standard commands (CUPS, for example, installs its own set of "lp").

In Linux world (in Debian, at least), /usr/local/bin are put always first.

I understand that it's easy to change that when needed (modifying the "path" variable within the shell rc files), but I was just wondering why the developers made that decisions.

Thanks in advance for any clarifications.
 
It's probably to keep the system in a predictable state if you use the defaults. It's kind of assumed that if you want to override system binaries with /usr/local/bin you are an advanced user and know what you're doing.
 
Moreover, as all BSD's are operating systems, they offer a working bare minimum that someone can work with. So, it comes quite natural to "prioritise" world binaries over ports/packages binaries. On the other hand, if a port/package is "confident" enough, it may install binaries in /usr/bin or /usr/sbin, depending on the convention it uses. Perl is an example of a port that is not included in base but can install binaries outside of /usr/local and security/heimdal is an example which allows you to override the base system binaries.

In the end, as you've already mentioned, it's up to you to set your default path to point anywhere you wish with whatever order you prefer.
 
Back
Top