Path: utzoo!attcan!uunet!mcvax!hp4nl!orcenl!bengsig From: bengsig@orcenl.uucp (Bjorn Engsig) Newsgroups: comp.unix.wizards Subject: Re: Bug/misfeature in 4bsd /bin/sh Summary: Logical OR ? Message-ID: <193.nlunix6@orcenl.uucp> Date: 21 Nov 88 09:02:58 GMT References: <117@sickkids.UUCP> <5538@sdcrdcf.sm.unisys.com> Organization: ORACLE Europe, The Netherlands Lines: 20 In article <5538@sdcrdcf.sm.unisys.com>, eggert@sea.sm.unisys.com (Paul Eggert) writes: > Mark Bartelt complained that in Berkeley Unix the shell command (X|Y|Z) ... > > 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? Oh no! We have the logical OR and AND as || and &&, and they are of course not pipe-symbols (they combine pipelines). Do you mean that (x|y|z) should never call z if y returned non-zero? Or should the all be called and the return codes simply logical OR'ed? In this case, what would the meaning be of, say 1|2|3 == 3, or 1|0|3 == 3? The SysV behaviour is the only acceptable one. -- Bjorn Engsig, ORACLE Europe \ / "Hofstaedter's Law: It always takes ..!uunet!mcvax!orcenl!bengsig X longer than you expect, even if you phone: +31 21 59 56 411 / \ take into account Hofstaedter's Law"