Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!linus!philabs!cmcl2!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.unix-wizards Subject: Re: Please do NOT use "/bin/test" as a command name Message-ID: <496@brl-tgr.ARPA> Date: Tue, 10-Dec-85 10:31:09 EST Article-I.D.: brl-tgr.496 Posted: Tue Dec 10 10:31:09 1985 Date-Received: Wed, 11-Dec-85 22:14:44 EST References: <313@bdaemon.UUCP> <13400016@mirror.UUCP> <1016@sdcsla.UUCP> <1019@utcs.uucp> Organization: Ballistic Research Lab Lines: 27 I have to disagree with Ian on this one. Because you never know what kind of weird $PATH people will be using, it is essential when writing shell scripts for use by others to FORCE the correct commands to be used in your shell script, in order to guarantee that the script does what you intended. The simplest way to do this is to just set PATH=whatever at the front of the script. Besides being less trouble than using absolute pathnames, this also handles problems like: Is "sort" in /bin or /usr/bin (or /usr/5bin)? The internals of a utility are subject to change. You can't even reasonably make the user responsible for looking inside utilities to see whether they will work in conjunction with his $PATH. As far as a user should be concerned, a utility should be a "black box" that does its job reliably and without fuss. If you're going to make a utility reliable, its internal operation should be protected against environmental factors except when they are a deliberate part of the interface. If someone has his own "rm" command (some of our users do), how do you know that it is suitable for use in your script to remove a link? The answer is, you don't.