🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #1251

Re: Bug/misfeature in 4bsd /bin/sh

#1251
From: Paul Eggert
Date: Sun, 20 Nov 1988 00:26
13 lines
1258 bytes
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?
Technical Details
Message-ID: <5538@sdcrdcf.sm.unisys.com>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!peregrine!elroy!ames!ucsd!orion.cf.uci.edu!oberon!sm.unisys.com!sea!eggert
References: <117@sickkids.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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