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

Tim Bray tbray at mprvaxa.UUCP
Fri Dec 13 10:53:13 AEST 1985


I am NOT a unix-wizard.  But it seems elementary to me that all shell scripts
should be as follows:

#!/bin/sh
PATH=/bin:/usr/bin:/usr/ucb   # 'n maybe some more
if test bletch ....
mv foo
rm bar
etc..

That way you can't get bitten by (maybe intentional) name duplication, you
will preserve the flexibility of path usage, and everything is hunky dory.
This assumes that you can trust the contents of /bin:/usr/bin:/usr/ucb.
If you want to use nonstandard commands as a privileged person, you should
#$&*)$ well have them in a protected place - we use /opr.

We had a secretary who created a little script called 'test' (dunno why) that 
printed out some guy's performance appraisal on her screen, and it turns
out there were a FEW system scripts promiscuously using 'test' without
protecting their paths - she was pretty upset for a while.



More information about the Comp.unix.wizards mailing list