9front - general discussion about 9front
 help / color / mirror / Atom feed
* Compound commands and pipes in rc
@ 2016-04-20 13:15 Alex Musolino
  2016-04-27  7:06 ` [9front] " Rudolf Sykora
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Musolino @ 2016-04-20 13:15 UTC (permalink / raw)
  To: 9front

Hi all,

I have come across some suspect behaviour in rc. I have trawled the
man page but it doesn't seem to have much to say on the matter.

Consider the following rc script:

bind '#|' /n/gopher
>[3=1] {
    echo
    cat </n/gopher/data >[1=3]
} | aux/trampoline tcp!gopherproject.org!70 >/n/gopher/data1

This produces no output, whilst the following script does:

bind '#|' /n/gopher
>[3=1] {
    echo
    cat </n/gopher/data >[1=3]
    echo >/dev/null
} | aux/trampoline tcp!gopherproject.org!70 >/n/gopher/data1

It would seem that in the first example the unnamed pipe is closed
after echo exits and therefore before aux/trampoline can read anything
from the remote end much less write anything to the named pipe.

Can someone confirm whether or not this is the case and, if so,
whether or not it is expected behaviour?

--
Cheers,
Alex Musolino


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] Compound commands and pipes in rc
  2016-04-20 13:15 Compound commands and pipes in rc Alex Musolino
@ 2016-04-27  7:06 ` Rudolf Sykora
  0 siblings, 0 replies; 2+ messages in thread
From: Rudolf Sykora @ 2016-04-27  7:06 UTC (permalink / raw)
  To: 9front

Hello,

On 20 April 2016 at 15:15, Alex Musolino <musolinoa@gmail.com> wrote:
> Hi all,
>
> I have come across some suspect behaviour in rc. I have trawled the
> man page but it doesn't seem to have much to say on the matter.
>
> Consider the following rc script:
>
> bind '#|' /n/gopher
>>[3=1] {
>     echo
>     cat </n/gopher/data >[1=3]
> } | aux/trampoline tcp!gopherproject.org!70 >/n/gopher/data1
>
> This produces no output, whilst the following script does:
>
> bind '#|' /n/gopher
>>[3=1] {
>     echo
>     cat </n/gopher/data >[1=3]
>     echo >/dev/null
> } | aux/trampoline tcp!gopherproject.org!70 >/n/gopher/data1
>
> It would seem that in the first example the unnamed pipe is closed
> after echo exits and therefore before aux/trampoline can read anything
> from the remote end much less write anything to the named pipe.
>
> Can someone confirm whether or not this is the case and, if so,
> whether or not it is expected behaviour?

I don't really understand your question, but would recommend
you to ask in the plan9 mailing list; people there might know better.
Ruda


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-27  7:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-20 13:15 Compound commands and pipes in rc Alex Musolino
2016-04-27  7:06 ` [9front] " Rudolf Sykora

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).