On Unix, the PATH
environment variable effectively specified what "personality" the operating system had.
On MS/PC/DR-DOS, length limitations in the command interpreter meant that one could not have a PATH
environment variable value longer than some 120 characters.
(The operating system itself allowed longer; this was an artefact of the command interpreters themselves not permitting command lines longer than that to be entered.
Famously, Rex Conn's 4DOS allowed longer command lines, and longer values for the PATH
environment variable to be directly entered without resorting to script tricks.)
On Unix, shells were nowhere near as constrained, and PATH
variable values could look like this:
# PATH sets the initial shell PATH variable # #PATH=/usr/bin:/etc:/bin:/boot/grub:/boot/grup/bin:/boot/solaris/bin:/sbin:\ /usr/openwin/bin:/usr/5bin://usr/X11/bin:/usr/apache/bin:/usr/apache2/bin:\ /usr/appserver/bin:/usr/ccs/bin:/usr/dt/bin:/usr/j2se/bin:usr/local/bin:\ /usr/oasys/bin:/usr/pgadmin3/bin:/usr/proc/bin:/usr/sadm/bin:\ /usr/sadm/admin/bin:/usr/sadm/sysadm/bin:/usr/sbin:/usr/sfw/bin:\ /usr/sfw/i386-sun-solaris2.10/bin:/usr/sfw/sbin:/usr/snadm/bin:\ /usr/sunvts/bin:/usr/ucb:/usr/ucb:/usr/vmsys/bin:/usr/xpg4/bin:\ /usr/xpg6/bin
— login.dfl
. Sun Microsystems, Inc.. 2004-06-25.
One part of the modern model in Unix-imitators is that everything goes into one giant directory, be it Daniel J. Bernstein's /command
or Arch Linux's /usr/bin
.
This of course causes all of the well-known and usual headaches with different commands named the same thing.
An example of one such command name shared by multiple commands is fastboot
(which in other models would be distinguished by being in either bin/
or sbin/
).
But that wasn't the model then.
The model then was a whole load of command directories.
What subset of them one chose to have listed in the value of the PATH
environment variable, and in what order, determined the personality of the operating system that one saw.
The command search path could, and to an extent still can, include things such as:
/bin
and /usr/bin
/sbin
and /usr/sbin
/etc
and /usr/etc
/etc
.)/5bin
and /usr/5bin
/usr/ucb
/usr/mbin
/usr/bin
tools/usr/rbin
/usr/lbin
/usr/local/bin
/usr/amdahl/bin
and /usr/sun/bin
/usr/${OEM}/bin
and from which a parallel can be drawn to /usr/local/bin
/usr/games
/usr/ccs/bin
/usr/xpg4/bin
/usr/xpg6/bin
/opt/sfw/bin
/opt/csw/bin
/opt/SUNWspro/bin
/usr/local/bin
/opt
subdirectory or CSW
Sun/Oracle operating systems, and their open source derivatives, were at their height perhaps the most extreme examples of such multiple personality operating systems.
(Oracle has since chucked several of these directories, including /usr/ucb
and /usr/ccs
, away.)
But some of the aforegiven are from AIX and others.
/usr/amdahl/bin
is from UTS, for example.
What program one ran from a given command name depended from what personality one was choosing.
The idea that there was, and must be, only one program for any given command name was daft.
After all, differentiating commands of the same names was what PATH
was for.
The (post-2005, ksh93q) AT&T Korn shell's mechanism for enabling extra built-in commands, the inclusion of /opt/ast/bin
in the value of PATH
, ties in with the idea that one is expected to use PATH
to control personality.
This is the /usr/${OEM}/bin
pattern, with ast
standing for AT&T Software Technology.
To an extent, this idea survives to this day.
The "standard PATH", obtainable from the getconf PATH command or the _CS_PATH
parameter to the confstr()
library function, is notionally the value for the PATH
environment variable that enables access to all of the Single Unix Specification's "standard shell and utilities" without explicitly supplying pathnames for them.
It is, effectively, the "Standard Unix" personality value for PATH
on any given system.
On operating systems that have taken the Bernstein approach, such as Debian Linux, this path is just /bin:/usr/bin or even solely /usr/bin. (On Debian Linux, there are no standard utilities in /usr/sbin, which rather contains things such as agetty, ldconfig, hwinfo, and tarcat.) On other operating systems, in contrast, the "Standard Unix" personality is composed from more directories. NetBSD uses /usr/bin:/bin:/usr/sbin:/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/local/bin:/usr/local/sbin for example; and OpenBSD /usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/bin:/usr/local/sbin.
David Fiedler, Bruce H. Hunter, Stephen G. Kochan, and Patrick H. Wood (1986).
"/usr
— The Mystery Directory".
UNIX system administration.
Hayden Book Company.
ISBN 9780810462892.
pp. 54 et seq.
XPG. Standards, Environments, and Macros. Oracle Solaris Manual Pages. Oracle. 2014.
XPG4. Standards, Environments, and Macros. SunOS Manual Pages. Oracle. 2004.
Michael R. Ault (1996). UNIX System Administrator's Companion. Wiley. ISBN 9780471111443.