Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 SMI; site sun.uucp Path: utzoo!linus!philabs!prls!amdimage!amdcad!decwrl!sun!guy From: guy@sun.uucp (Guy Harris) Newsgroups: net.nlang,net.unix Subject: Re: nonsense words for files Message-ID: <2191@sun.uucp> Date: Sat, 18-May-85 03:42:50 EDT Article-I.D.: sun.2191 Posted: Sat May 18 03:42:50 1985 Date-Received: Mon, 20-May-85 04:23:05 EDT References: <1936@sdcrdcf.UUCP> <1940@sdcrdcf.UUCP> <1017@ihuxb.UUCP> <196@azure.UUCP> <1664@ittvax.UUCP> Organization: Sun Microsystems, Inc. Lines: 31 Xref: linus net.nlang:2813 net.unix:3979 > > On what UNIX systems (or what shells) is test part of the shell? On > > every system (and shell) I've used, it's in /bin/test. > /bin/test will probably always be there but in the SysV R2 Bourne > shell 'test' is a builtin. It's a builtin in System III and System V (release 1 and 2). It probably was a builtin in UNIX/TS 1.0 and PWB/UNIX 2.0 (the predecessors to System III). System V doesn't have "/bin/test" because it doesn't need it. There is also a stub of code in the V7 shell (which is the 4.xBSD shell as well) to have "test" be a builtin under the name "[". In the TS 1.0/PWB 2.0/S3/S5 shell, it's builtin under the name "[" as well as "test". Furthermore, if you do ln /bin/test /bin/[ under V7, you can call it "[" as well; 4.xBSD comes with this already done. That way, you can write if [ -f /etc/foo ] instead of if test -f /etc/foo which, arguably, looks cleaner. Building it into the shell makes scripts which do lots of "test"s run much faster. Guy Harris