Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84 exptools; site ihuxb.UUCP Path: utzoo!watmath!clyde!cbosgd!ihnp4!ihuxb!wfmans From: wfmans@ihuxb.UUCP (w. mansfield) Newsgroups: net.nlang,net.unix Subject: Re: nonsense words for files Message-ID: <1025@ihuxb.UUCP> Date: Mon, 20-May-85 18:05:42 EDT Article-I.D.: ihuxb.1025 Posted: Mon May 20 18:05:42 1985 Date-Received: Tue, 21-May-85 07:12:16 EDT References: <1936@sdcrdcf.UUCP> <1940@sdcrdcf.UUCP> <1017@ihuxb.UUCP> <196@azure.UUCP> <1664@ittvax.UUCP> <2191@sun.uucp> Organization: AT&T Bell Laboratories Lines: 40 Xref: watmath net.nlang:3094 net.unix:4572 > > > 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 AIIIIIIEEEEE! I'm sorry I started a UNIX dialogue in net.nlang. If there's interest, let's move the discussion to net.unix only, and leave the language au natural folks alone. -- Bill Mansfield AT&T Information Systems, Naperville, IL {ihnp4!}ihuxb!wfmans