Xref: utzoo comp.unix.questions:13759 comp.sys.sequent:283 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!uwvax!dogie.macc.wisc.edu!csd4.milw.wisc.edu!lll-winken!uunet!auspex!guy From: guy@auspex.auspex.com (Guy Harris) Newsgroups: comp.unix.questions,comp.sys.sequent Subject: Re: Possible Sh bug? Message-ID: <1667@auspex.auspex.com> Date: 20 May 89 11:18:10 GMT References: <1002@syma.sussex.ac.uk> <2400049@kailand> Reply-To: guy@auspex.auspex.com (Guy Harris) Followup-To: comp.unix.questions Organization: Auspex Systems, Santa Clara Lines: 19 >The status 1 after the "if" command is the one returned by the last command >executed, in this case "test". ("[" is a link to test - see the man page for >test(1)). The first isn't true in SunOS 3.0 and later; to quote from another article: Although this may not be strictly relevant to these particular machines, according to the SysV manual entry for sh(1), "If no *else* list or *then*" list is executed, then the *if* command returns a zero exit status." which *is* relevant to the Sun, since the Bourne shell in SunOS has been derived from the System V version since SunOS 3.0 (R2 in 3.x, R3.1 in 4.x). The second is true in SunOS, but irrelevant - the S5 Bourne shell has "[" as a builtin, with "test" a synonym for it.