From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@9fans.net From: =?UTF-8?Q?Maur=C3=ADcio?= CA Date: Mon, 25 Apr 2011 00:16:19 +0000 Message-ID: References: <86wrijennb.fsf@cmarib.ramside> <20110424171741.D5865B827@mail.bitblocks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit User-Agent: slrn/0.9.9p1 (Linux) Subject: Re: [9fans] Different results for the same rc script when using listen1 Topicbox-Message-UUID: d421a0bc-ead6-11e9-9d60-3106f5b1d025 > Doesn't fail here. > > Make sure you are running $PLAN9/bin/rc. If so, rebuild all (to start > from a clean slate) and rerun your test Uninstalled distribution package for plan9 and got .tgz at: http://swtch.com/plan9port/plan9port.tgz MD5 checksum matched. Unpacked to /usr/local, executed ./INSTALL and added recommended variables to the system profile. $ echo $PATH ----- $PLAN9 | tr ': ' '\n\n' /usr/local/bin /usr/bin /bin /usr/local/sbin /usr/sbin /sbin /usr/bin/core_perl /usr/local/plan9/bin ----- /usr/local/plan9 Changed the test script, now named test.rc, to: #!/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 } Running /home/mauricio/test.rc: first at path: /usr/local/plan9/bin 1 is different from 3 2 is different from 3 3 equals 3 4 is different from 3 5 is different from 3 Now with listen1 and dial: $ /usr/local/plan9/bin/9 listen1 'tcp!localhost!8080' /home/mauricio/test.rc & $ /usr/local/plan9/bin/9 dial 'tcp!localhost!8080' first at path: /usr/local/plan9/bin 1 equals 3 2 equals 3 3 equals 3 4 equals 3 5 equals 3 My platform: $ uname -a | fmt Linux dumbo 2.6.38-ARCH #1 SMP PREEMPT Sun Apr 17 15:18:58 CEST 2011 x86_64 Intel(R) Core(TM)2 CPU 6400 @ 2.13GHz GenuineIntel GNU/Linux This is really weird. I don't even know what could I check. 'listen1' source code is pretty clean, and it calls command and args with a simple 'exec' call. The only thing that was also unusual is that the 'net' variable, which is supposed to be set to a directory, is always blank, but the line with 'putenv' and 'net' in 'listen1.c' is commented out, so this is to be expected. Thanks, MaurĂ­cio