From mboxrd@z Thu Jan 1 00:00:00 1970 From: erik quanstrom Date: Mon, 14 Dec 2009 09:08:06 -0500 To: 9fans@9fans.net Message-ID: <0d3820e90fedfa15c374652fe64f06b4@ladd.quanstro.net> In-Reply-To: <<8e04b5820912140211nd4edf3ei851c5a5128438d96@mail.gmail.com>> References: <<8e04b5820912140211nd4edf3ei851c5a5128438d96@mail.gmail.com>> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] rc shell UNIX port repository Topicbox-Message-UUID: b0046d14-ead5-11e9-9d60-3106f5b1d025 > Unfortunately after playing a little bit more with rc, and trying > it's syntax and semantics to the limit, I've also found other nasty > bugs (some of which I've fixed, other I was not able to do so)... what nasty bugs? could you give some specifics. > By the way, what is the expected outcome of the following snippet > of code when the `-e` (exit on non-0 exit code) is on: > > { echo 1 ; false ; echo 2 } || echo 3 > > Case a) it should print `1` and exit because the false in the > middle of the block just failed; > Case b) it should print `1`, and then `2`, because `false` is > inside a block that is part of a `||` command; > Case c) it should print `1`, and then `3`, because `false` has > stopped the evaluation of the block, and made the entire block exit > code be `1`. that's not a bug. -e is only evaluated at the end of a full rc production. in yiour case, there is only one production and it $status is '' (true) at the end of it. since echo 3 sets status to true. - erik