Please do NOT use "/bin/test" as a command name

Gregory M. Paris gmp at rayssd.UUCP
Wed Dec 11 11:42:49 AEST 1985


> No, no, no. Do not use absolute paths for test, mv, cp, or
> anything else. Least of all in shell files.
> 
> Sure, once in a while a new user will make a program called `test'
> and get confused. Some people even do it twice (I did). Most
> people don't do it a third time.

As you mentioned, this kind of problem crops up not only with
"test" but with many of the oft-used UNIX utilities.  For those of
us that support a user community of hundreds, even one or two "custom"
utility problems per user can become quite a time consuming hassle.
Just about any shell script can be broken with custom utilities, and
I certainly don't expect every user to have the savvy to figure out
which ones his/her new "rm" command is going to break (try rm -i -f).

There's more than a speed advantage to including full pathnames,
and only very minor portability problems associated with the practice.
I'm not saying that you *must* or even *should* include full pathnames,
but I disagree completely with your saying *never*!

As a compromise, how about setting PATH at the beginning of the script?
-- 

++---------------------------------------------------------------------------++
||  Greg Paris             {allegra,linus,raybed2,ccice5,brunix}!rayssd!gmp  ||
++---------------------------------------------------------------------------++



More information about the Comp.unix.wizards mailing list