From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <17b8dd6f-0f07-4801-968f-0d6ad6392c9a@b36g2000prf.googlegroups.com> References: <8e04b5820912052352w304556cdufac28cc2dd3f9ffe@mail.gmail.com> <17b8dd6f-0f07-4801-968f-0d6ad6392c9a@b36g2000prf.googlegroups.com> Date: Mon, 14 Dec 2009 12:11:44 +0200 Message-ID: <8e04b5820912140211nd4edf3ei851c5a5128438d96@mail.gmail.com> From: "Ciprian Dorin, Craciun" To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [9fans] rc shell UNIX port repository Topicbox-Message-UUID: afdf74b4-ead5-11e9-9d60-3106f5b1d025 On Mon, Dec 14, 2009 at 11:49 AM, weakish wrote: > On Dec 6, 3:54=C3=82=C2=A0pm, ciprian.crac...@gmail.com (Ciprian Dorin, C= raciun) > wrote: > >> =C3=82=C2=A0 =C3=82=C2=A0 Now I'm trying to contribute back to the commu= nity, and I've sent >> an email to Tig Goodwin (at t...@star.le.ac.uk), which the mail server >> rejected (it seems that the email is not valid any more). > > Have you tried this email to contact Tim Goodwin: info@libra-aries- > books.co.uk > > Currently I'm not aware of any mail-list/code-repository dedicated to > rc shell. Thanks, I'll try to contact him at that address... 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)... So for the moment I'm back to Bash... (But I'm planning on implementing an ASM like language and associated virtual machine, that would allow UNIX "glue" programs to be written.) Ciprian. ~~~~ 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`. I would prefer case 1, (treat any non-zero exit command like an abnormal exception in the script), but with the addition of a "block return" construct that would allow me to exit only from the current block, like (I'm calling the "block return" keyword "block_return" { mkdir ./downoads || block_return 1 pushd ./downloads # exception could happen, but only in race condit= ions wget http://somesite.com/somefiles.tar || block_return 2 tar -x ./somefiles.tar || block_return 3 rm ./somefiles.tar # again it should normally just work } || echo "there was some error"^$status