9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "Iruatã Souza" <iru.muzgo@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] Different results for the same rc script when using listen1
Date: Sun, 24 Apr 2011 23:14:01 -0300	[thread overview]
Message-ID: <BANLkTimVRHbkJUBkJm1g6RBXz7K9bS09Rg@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinbO=VJ=2TQ9PP+Xa+WSR2qi7JMHA@mail.gmail.com>

On Sun, Apr 24, 2011 at 11:03 PM, andrey mirtchovski
<mirtchovski@gmail.com> wrote:
>>   #!/usr/local/plan9/bin/9 rc
>>   echo first at path: $path(1)
>>   for (i in `{seq 1 5}){
>>       if (test $i -eq 3) {
>>           echo $i equals 3
>>       }
>>       if not echo $i is different from 3
>>   }
>
> NB: in general, you don't need 'test'. use "if (~ $i 3) {}".
>
> that said, now I'm convinced there's a bug somewhere. I got your code
> to fail under the condition that rc is started via the '9' environment
> (9 rc). the type of 'test' binary doesn't matter -- both /bin/test and
> $PLAN9/bin/test break under '9', but don't break without it. the '9'
> script is pretty simple, but there appear do be some side-effects
> (probably due to \r being transmitted over the network?). here's the
> simplest version of your script:
>
> $ cat t.rc
> #!/usr/bin/env rc
> exec rc
> $
>
> dial and test:
>
> $ dial -e 'tcp!localhost!8080'
> ######## no breakage
> /bin/test 1 -eq 2 ; echo $status
> 1
> /bin/test 1 -eq 1; echo $status
>
> /Users/andrey/plan9/bin/test 1 -eq 2; echo $status
> 1
> /Users/andrey/plan9/bin/test 1 -eq 1; echo $status
>
> ######## now see it break
> 9 rc
> /bin/test 1 -eq 2 ; echo $status
>
> /bin/test 1 -eq 1; echo $status
>
> /Users/andrey/plan9/bin/test 1 -eq 2; echo $status
>
> /Users/andrey/plan9/bin/test 1 -eq 1; echo $status
>
> ls | wc > /dev/null; echo $status
> |
> ls | wc > /dev/null; echo $status
> |||
> ls | wc > /dev/null; echo $status
> |||||||
> ls | wc > /dev/null; echo $status
> |||||||||||||||
> ls | wc > /dev/null; echo $status
> |||||||||||||||||||||||||||||||
>
> #####back to non-breaking rc:
> exit
> echo $status
>
> ls | wc > /dev/null; echo $status
> |
> ls | wc > /dev/null; echo $status
> |
> ls | wc > /dev/null; echo $status
> |
> ls | wc > /dev/null; echo $status
> |
> ls | wc > /dev/null; echo $status
> |
>
>

I'm seeing this without the 9. It is a Ubuntu 10.04.2 LTS,

$ uname -a
Linux goitaca 2.6.32-28-generic #55-Ubuntu SMP Mon Jan 10 23:42:43 UTC
2011 x86_64 GNU/Linux



  reply	other threads:[~2011-04-25  2:14 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-24  5:09 Maurício CA
2011-04-24  5:22 ` andrey mirtchovski
2011-04-24  7:30   ` Maurício CA
2011-04-24 14:20 ` smiley
2011-04-24 17:05   ` Maurício CA
2011-04-24 17:17     ` Bakul Shah
2011-04-25  0:16       ` Maurício CA
2011-04-25  2:00         ` Anthony Martin
2011-04-25  3:14           ` Maurício CA
2011-04-25  3:17           ` erik quanstrom
2011-04-25  3:36             ` erik quanstrom
2011-04-25  3:58               ` Bakul Shah
2011-04-25  4:39                 ` erik quanstrom
2011-04-25  5:27                   ` Lyndon Nerenberg
2011-04-25  5:53                   ` Bakul Shah
2011-04-25  6:59                     ` Robert Ransom
2011-04-25 14:56                       ` Bakul Shah
2011-04-25 15:00                         ` erik quanstrom
2011-04-25 16:17                         ` Skip Tavakkolian
2011-04-25 16:27                           ` Joseph Stewart
2011-04-25 20:13                           ` smiley
2011-04-25 20:16                             ` Lyndon Nerenberg
2011-04-25 20:18                             ` erik quanstrom
2011-04-25 14:44                     ` erik quanstrom
2011-04-25 13:53               ` Maurício CA
2011-04-25 14:42                 ` erik quanstrom
2011-04-27 21:57                   ` Maurício CA
2011-04-26  9:02               ` dexen deVries
2011-04-26 12:57                 ` erik quanstrom
2011-04-25  2:03         ` andrey mirtchovski
2011-04-25  2:14           ` Iruatã Souza [this message]
2011-04-25  2:20             ` andrey mirtchovski

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=BANLkTimVRHbkJUBkJm1g6RBXz7K9bS09Rg@mail.gmail.com \
    --to=iru.muzgo@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).