From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 16 May 2012 15:43:46 +0100 Message-ID: From: Charles Forsyth To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=0015175cbab2be8f9f04c0285881 Subject: Re: [9fans] rc behavior with rfork Topicbox-Message-UUID: 8f67c82e-ead7-11e9-9d60-3106f5b1d025 --0015175cbab2be8f9f04c0285881 Content-Type: text/plain; charset=UTF-8 On 16 May 2012 15:31, wrote: > The confusing part to me is why >[2] or >[3] or >[4] > (and so on) captures the stdout of the @{} block. > it doesn't: look closely at your commands. term% @{rfork e; echo hi} >[2]/env/hi; echo test; cat /env/hi hi test the echo hi is going to standard output, which is not captured. the >[2]/env/hi is creating an empty env variable in the parent shell scope (name space). echo test goes to standard output, and cat /env/hi prints the empty env variable on standard output. --0015175cbab2be8f9f04c0285881 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On 16 May 2012 15:31,=C2=A0<sl@9front.= org>=C2=A0wrote:
The confusing part to me is why >[2] or >[3] or >[4]
(and so on= ) captures the stdout of the @{} block.

=C2=A0it doesn't: look closely at your comman= ds.

term% @{rfork e= ; echo hi} >[2]/env/hi; echo test; cat /env/hi
hi
test=

the echo hi is going to standard output, which is not captur= ed.
the >[2]/env/hi is creating an empty env variable in the p= arent shell scope (name space).
echo test goes to standard output= , and cat /env/hi prints the empty env variable on standard output.

--0015175cbab2be8f9f04c0285881--