Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site utcs.uucp Path: utzoo!utcs!ian From: ian@utcs.uucp (Ian F. Darwin) Newsgroups: net.unix-wizards Subject: Please do NOT use "/bin/test" as a command name Message-ID: <1019@utcs.uucp> Date: Sun, 8-Dec-85 16:55:16 EST Article-I.D.: utcs.1019 Posted: Sun Dec 8 16:55:16 1985 Date-Received: Sun, 8-Dec-85 17:08:49 EST References: <313@bdaemon.UUCP> <13400016@mirror.UUCP> <1016@sdcsla.UUCP> Reply-To: ian@utcs.UUCP (Ian F. Darwin) Organization: University of Toronto - General Purpose UNIX Lines: 47 In article <1016@sdcsla.UUCP> west@sdcsla.UUCP (Larry West) writes: >However, I would like to point out that users have a habit >of naming programs "test", and of having "/bin" occur late >in their paths. This tends to cause confusion because the >problem (as usual) doesn't come up until that brief "test" >program has been forgotten. > >So, my suggestion is to always use "/bin/test" instead >of simply "test", or else use "[ ]". I know, fixing >the particular pathname of a program is a bad idea, but this >seems a fairly safe case (unless you plan to provide an >improved user interface to "test":-). 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. Note that the problem only comes up if you have your `test' program in your $HOME/bin (what you call your private bin directory) OR if you are in the same directory where you made that long-forgotten test program. On the other hand, if you post even a single shell file with /bin/test in it, your `error' will be repeated hundreds of times all over the world. Why is it an error? I call it an error because it violates the portability principle: UNIX uses the PATH environment variable to find programs, rather than making the user specify full path names for programs. This allows you to write your own. Why would anybody want to mv test out of /bin? Well, what if somebody decides that test is used so often that it belongs in the shell? Then you have to keep two versions of test around -- a fast one inside the shell, and a slow one for `erroneuos' shell files. Oh, you say that they already did this in some release of System V? My, what a surprise. I'm equally against the practice of putting /bin/rm, /bin/mv, etc into shell files. Please use rm, mv, etc, rather than the full paths. You don't know what might motivate me to have my own version of rm (indeed, you probably don't want to know what motivates me :=!). Please use the facilities that UNIX provides. Don't negate UNIX's wonderful generality for the benefit of a few nanoseconds. Ian Darwin Toronto, Canada