From mboxrd@z Thu Jan 1 00:00:00 1970 To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> In-reply-to: Your message of "Sun, 24 Apr 2011 17:05:43 -0000." References: <86wrijennb.fsf@cmarib.ramside> Date: Sun, 24 Apr 2011 10:17:41 -0700 From: Bakul Shah Message-Id: <20110424171741.D5865B827@mail.bitblocks.com> Subject: Re: [9fans] Different results for the same rc script when using listen1 Topicbox-Message-UUID: d3623920-ead6-11e9-9d60-3106f5b1d025 On Sun, 24 Apr 2011 17:05:43 -0000 =?UTF-8?Q?Maur=C3=ADcio?= CA wrote: > >> How can running a script throw 'listen1' can get 'rc' to fail an > >> 'if' test?!?! > > > This looks like you're using p9p. Have you checked your PATH? > > It might not be finding an executable, or finding the wrong version > > of an executable. > > Sure. Take, for instance, this script uniquely named 'tester.rc': > > #!/usr/bin/env rc > echo -n I am the real tester: > ~ $1 $2 > > I can change 'listen_test.rc' to use it: > > #!/usr/bin/env rc > for (i in `{seq 1 5}){ > if (./tester.rc $i 3) { > echo ' ' $i equals 3 > } > if not echo ' ' $i is different from 3 > } > $listen1 'tcp!localhost!8080' ./listen_test.rc & > $dial -e 'tcp!localhost!8080' 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 cd $PLAN9 # may be even do: hg pull -u ./INSTALL