Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mprvaxa.UUCP Path: utzoo!utcsri!ubc-vision!mprvaxa!tbray From: tbray@mprvaxa.UUCP (Tim Bray) Newsgroups: net.unix-wizards Subject: Re: Please do NOT use "/bin/test" as a command name Message-ID: <674@mprvaxa.UUCP> Date: Thu, 12-Dec-85 19:53:13 EST Article-I.D.: mprvaxa.674 Posted: Thu Dec 12 19:53:13 1985 Date-Received: Thu, 12-Dec-85 22:30:31 EST References: <313@bdaemon.UUCP> <13400016@mirror.UUCP> <1016@sdcsla.UUCP> <1019@utcs.uucp> <1747@dciem.UUCP> Reply-To: tbray@mprvaxa.UUCP (Tim Bray) Organization: Microtel Pacific Research, Burnaby, B.C., Canada Lines: 25 Summary: 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.