9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Ciprian Dorin, Craciun" <ciprian.craciun@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] rc shell UNIX port repository
Date: Mon, 14 Dec 2009 12:11:44 +0200	[thread overview]
Message-ID: <8e04b5820912140211nd4edf3ei851c5a5128438d96@mail.gmail.com> (raw)
In-Reply-To: <17b8dd6f-0f07-4801-968f-0d6ad6392c9a@b36g2000prf.googlegroups.com>

On Mon, Dec 14, 2009 at 11:49 AM, weakish <weakish@gmail.com> wrote:
> On Dec 6, 3:54 pm, ciprian.crac...@gmail.com (Ciprian Dorin, Craciun)
> wrote:
>
>>     Now I'm trying to contribute back to the community, 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 conditions
        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



  reply	other threads:[~2009-12-14 10:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-06  7:52 Ciprian Dorin, Craciun
2009-12-06 11:36 ` Charles Forsyth
2009-12-06 12:58   ` Ciprian Dorin, Craciun
2009-12-06 13:37     ` Frederik Caulier
2009-12-06 13:37     ` Charles Forsyth
2009-12-06 18:38 ` Axel Belinfante
2009-12-14  9:49 ` weakish
2009-12-14 10:11   ` Ciprian Dorin, Craciun [this message]
     [not found] <<8e04b5820912052352w304556cdufac28cc2dd3f9ffe@mail.gmail.com>
2009-12-06 15:24 ` erik quanstrom
     [not found] <<8e04b5820912140211nd4edf3ei851c5a5128438d96@mail.gmail.com>
2009-12-14 14:08 ` erik quanstrom
2009-12-14 15:15   ` Ciprian Dorin, Craciun
2009-12-14 16:14     ` erik quanstrom
2009-12-14 16:33       ` Ciprian Dorin, Craciun
2009-12-14 16:44         ` erik quanstrom
     [not found] <<0d3820e90fedfa15c374652fe64f06b4@ladd.quanstro.net>
2009-12-14 14:14 ` erik quanstrom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8e04b5820912140211nd4edf3ei851c5a5128438d96@mail.gmail.com \
    --to=ciprian.craciun@gmail.com \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).