In another thread I was cockily saying that any program [which is not part of the OS user interface, like a shell] with names like exit
, test
or help
is stupid. I meant to imply that such common names should be reserved to the top level user interface, usually a command shell or core OS utility.
User schily remarked that help
is a command of the sccs version control system which has been an integral part of Unix since the 70s. sccs is in fact included in the Single Unix Specification.
The online documentation of sccs seems ambiguous. Most pages list help
as an sccs subcommand, invoked as sccs help <topic>
. Then there is a /usr/bin/sccshelp
command. But another page indeed lists a dedicated /usr/ccs/bin/help
.
I assume that for sccs users /usr/ccs/bin/
would be in the path so that help
has been part of many Unix installations for 40 years1. In that case I would argue that even though the choice of command name is regrettable sccs would have seniority and bash should have called its built-in bash-help or the like.
So is it or was it common to have an (sccs
) help
command in your path?
1 This sounds weird.
Best Answer
The past did not work that way.
You are buying into a somewhat flawed modern model that wasn't the case at the time.
— Mike O'Brien (The Aerospace Corporation) <neat.ai.toronto.edu!pyramid!verdix!ogccse!tektronix!aerospace.aero.org!sequent!aero!obrien> via <haroldh@think.com> (1989-03-01). VAXen, my children, just don't belong some places. rec.humor.funny.Rather famously, Unix didn't not come with a simple help command for beginners. This was a hole (much discussed on on-line discussion fora) that was filled not just once, by the writers of the Bourne Again shell, but several times over. Mortice-Kern provided a
help
command that would search for doco to print from ahelpfile
using ahelpindex
. AT&T System 5 Release 3.2 had ahelp
command, too, for example:That this was in AT&T Unix rather puts the kibosh on the idea that superseding an SCCS command named
help
is illegitimate or that the writers of the Bourne Again shell were out of step. But there's more.We were expected to actually use
—PATH
.login.dfl
. Sun Microsystems, Inc.. 2004-06-25.One part of the modern model 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 headaches with different commands namedfastboot
(which in other models would be distinguished by being inbin/
andsbin/
). But that wasn't the model then.The model then is exemplified by the multiple variants of the
ls
command that I discussed and by questions such as "Nexenta bash script uses /usr/sun/bin/sed instead of /usr/bin/sed". There are a whole load of command directories, and what subset of them one chooses to have listed in the value of thePATH
environment variable, and in what order, determines the personality of the operating system that one sees.The command search path could, and to an extent still can, include things such as:
/bin
and/usr/bin/
— the traditional, pre-dating formal standardization, general toolsets; from a post-formal-standardization viewpoint, commands that conform to the System V Interface Definition and the X/Open Portability Guide version 3/sbin
and/usr/sbin/
— system administration tools/etc/
and/usr/etc/
— more system administration tools (Yes Virginia, executables once went in/etc/
.)/5bin
and/usr/5bin/
— System V (i.e. 5) compatibility directory with AT&T Unix System 5 compatible tools/usr/ucb/
— UCB (i.e. BSD) compatibility directory with BSD-compatible tools/usr/mbin/
— multi-byte character set capable variants of/usr/bin
tools/usr/rbin/
— tools made available by an administrator to some "restricted" shells/usr/lbin/
— locally-installed tools, a precursor of/usr/local/bin/
/usr/amdahl/bin/
and/usr/sun/bin/
— operating system vendor tools, more generally taking the form of/usr/${OEM}/bin
and from which a parallel can be drawn to/usr/local/bin
/usr/games/
— games/usr/ccs/bin
— various developer tools, as you have observed/usr/xpg4/bin/
— the directory with commands that behave in the ways dictated by the X/Open Portability Guide issue 4/usr/xpg6/bin/
— the directory with commands that behave in the ways dictated by the notional X/Open Portability Guide issue 6, more properly known as POSIX.1:2001 or the Single Unix Specification version 3/opt/sfw/bin/
— created by installing a CD of additional utilities from Sun, now known as the SunFreeware Companion CD/opt/csw/bin/
— OpenCSW and Blastwave tools/opt/SUNWspro/bin/
— commands from the Sun Workshop (now known as Oracle Developer Studio) tool suite,SUNW
being Sun's (original) stock exchange ticker code andspro
denoting the old product name SunPro/usr/local/bin/
— stuff provided by third parties who do not use an/opt
subdirectory or CSWSun/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.There was no notion of strict precedence.
Many commands lived and died quite rapidly. Bill Joy created an
iul
command as a precursor toul
, for example. BSD also once had agreek
command.The idea that a command was set in stone forever, and owned a name to the excusion of shell builtins and others, was fairly foreign, given the turnover in command sets.
Just for starters,
sh
itself had been variously the Thompson, Mashey, Bourne, and Korn shells within the space of a decade and a bit. The idea that the Thompson shell's externalif
command prevented the Bourne shell from havingif
as a keyword was of course ludicrous.Notice that 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 ofPATH
, both supports the notion that built-in commands can supplant external commands of the same names and ties in with the idea that one is expected to usePATH
to control personality. (ast
stands for AT&T Software Technology, by the way.)Further reading
help
command". Unix System V, release 3.2: user's guide. Prentice-Hall. 1989. pp. 2–23 et seq./usr
— The Mystery Directory". UNIX system administration. Hayden Book Company, ISBN 9780810462892. pp. 54 et seq.if
. Manuals. Etsh Project.ul
. Proposals.