Robert Elz <k...@munnari.oz.au> wrote: > Date: Tue, 14 Aug 2018 12:30:22 +0200 > From: Joerg Schilling <joerg.schill...@fokus.fraunhofer.de> > Message-ID: > <5b72af3e.ws0hf/j4O/wuiekr%joerg.schill...@fokus.fraunhofer.de> > > | break is a command that has an exit code that is the previous saved exit > code > > No, it isn't, its exit status is 0, it says so clearly, page 2387 line 76359
Sorry, the exist status is cleared before a builtin command runs. I was confusing this with ";;". > | and that has the side effect of leaving the loop. > > Yes. The big question is when that happens, does it > happen immediately, or does it happen after ... > > | The ! statement negates the current saved exit code and > | makes it the new saved exit code. > > that happens, and what in the standard tells us, one way > or the other (or even makes it unspecified, which I suspect > at this point is all we could do.) > > From your earlier message ... > > | Interesting is that dash returns 1 while mksh and posh return 0. > > I am not sure why, as best I can tell, dash and mksh share no > heritage whatever, mksh derives (I believe) from pdksh (way > back) which was a ksh88 clone (of a kind). posh I am know > nothing about. posh is derved from ash and it is a fun as it requires glibc specific bugs in order to work. > dash comes from ash which was a bourne shell clone (of a kind). > > | So it seems that older versions of ash return 0 while dash has > | been reworked at this point. > > No, just the opposite, dash (and the NetBSD sh) are "old ash" and > return 1, the FreeBSD sh (all of these ash descendants) has been > reworked to return 0. So you believe that posh is from a newer ash? This seems to be unlikely from looking into the code. Jörg -- EMail:jo...@schily.net (home) Jörg Schilling D-13353 Berlin joerg.schill...@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/'