From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: From: "Steve Simon" Date: Wed, 27 Feb 2013 15:41:58 +0000 To: 9fans@9fans.net MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: [9fans] rc script question Topicbox-Message-UUID: 205d0aa6-ead8-11e9-9d60-3106f5b1d025 Hi, rc is not working how I expect it to. This works fine echo a b c | rc -c 'a=`{read}; echo @ $a(2-) @' @ b c @ This i did not expect echo a b c | rc -c 'echo @ $(2-) @' @ @ Perhaps I need some expectation managment? -Steve From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 27 Feb 2013 15:53:47 +0000 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=089e010d857492a31304d6b6c780 Subject: Re: [9fans] rc script question Topicbox-Message-UUID: 20635ec4-ead8-11e9-9d60-3106f5b1d025 --089e010d857492a31304d6b6c780 Content-Type: text/plain; charset=UTF-8 i assumed you wanted a b c as command line arguments in the second case, not echoed in. in the first case, you indexed a variable. in the second case, you indexed nothing. % rc -c 'echo @ $*(2-) @' a b c @ b c @ On 27 February 2013 15:41, Steve Simon wrote: > Hi, > > rc is not working how I expect it to. > > This works fine > echo a b c | rc -c 'a=`{read}; echo @ $a(2-) @' > @ b c @ > > This i did not expect > echo a b c | rc -c 'echo @ $(2-) @' > @ @ > > Perhaps I need some expectation managment? > > -Steve > > --089e010d857492a31304d6b6c780 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
i assumed you wanted a b c as command line arguments = in the second case, not echoed in.
in the first case, you i= ndexed a variable. in the second case, you indexed nothing.

% rc -c 'echo @ $*(2-) @' a b c
@ b c @
<= div>


On 27 February 2013 15:41, Steve Simon <steve@quintile.net>= wrote:
Hi,

rc is not working how I expect it to.

This works fine
=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo a b c | rc -c 'a=3D`{read}; echo @ $a(= 2-) @'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @ b c @

This i did not expect
=C2=A0 =C2=A0 =C2=A0 =C2=A0 echo a b c | rc -c 'echo @ $(2-) @'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 @ @

Perhaps I need some expectation managment?

-Steve


--089e010d857492a31304d6b6c780-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: dexen deVries To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Date: Wed, 27 Feb 2013 17:06:35 +0100 Message-ID: <12629769.4igoszc5pW@coil> User-Agent: KMail/4.10 (Linux/3.8.0-rc7-l49; KDE/4.10.0; x86_64; ; ) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Subject: Re: [9fans] rc script question Topicbox-Message-UUID: 2071aa38-ead8-11e9-9d60-3106f5b1d025 On Wednesday 27 of February 2013 15:41:58 Steve Simon wrote: > This i did not expect > =09echo a b c | rc -c 'echo @ $(2-) @' > =09@ @ rc -c 'shift; echo @ $* @' `{echo a b c} surprisingly, * can be assigned to. echo a b c | rc -c '*=3D`{read}; shift; echo @ $* @' echo a b c | rc -c '*=3D`{read}; echo @ $*(2-) @' --=20 dexen deVries [[[=E2=86=93][=E2=86=92]]] From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <12629769.4igoszc5pW@coil> References: <12629769.4igoszc5pW@coil> Date: Fri, 1 Mar 2013 12:28:12 +0200 Message-ID: From: Yaroslav To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=bcaec51ddd49dd94dd04d6da76bf Subject: Re: [9fans] rc script question Topicbox-Message-UUID: 21d26750-ead8-11e9-9d60-3106f5b1d025 --bcaec51ddd49dd94dd04d6da76bf Content-Type: text/plain; charset=UTF-8 > surprisingly, * can be assigned to. > and this is why there's no bourne's "set" builtin. --bcaec51ddd49dd94dd04d6da76bf Content-Type: text/html; charset=UTF-8

surprisingly, * can be assigned to.

and this is why there's no bourne's "set" builtin.

--bcaec51ddd49dd94dd04d6da76bf--