Xref: utzoo comp.bugs.4bsd:1095 comp.unix.wizards:12663 Path: utzoo!attcan!uunet!peregrine!elroy!ames!ucsd!orion.cf.uci.edu!oberon!sm.unisys.com!sea!eggert From: eggert@sea.sm.unisys.com (Paul Eggert) Newsgroups: comp.bugs.4bsd,comp.unix.wizards Subject: Re: Bug/misfeature in 4bsd /bin/sh Message-ID: <5538@sdcrdcf.sm.unisys.com> Date: 20 Nov 88 00:26:02 GMT References: <117@sickkids.UUCP> Sender: news@sm.unisys.com Reply-To: eggert@sea.UUCP (Paul Eggert) Followup-To: comp.unix.wizards Organization: Unisys Santa Monica Lines: 13 Mark Bartelt complained that in Berkeley Unix the shell command (X|Y|Z) nondeterministically yields the exit status of X, Y, or Z, whereas in AT&T Unix (X|Y|Z) always yields the exit status of Z. He wrote that the Berkeley Unix folks had removed words from the man page, and asked why Berkeley "changed the semantics of the shell in this somewhat rude way?" I'm afraid Bartelt had his history backward. Older Bourne shells have the nondeterministic semantics; newer ones from AT&T are deterministic. AT&T made the change, not Berkeley. Unfortunately, under either semantics, you can't tell whether all the commands in a pipeline succeed. Instead, (X|Y|Z) should yield the logical OR of the exit statuses of X, Y, and Z. Why didn't AT&T see this?