Sending a string to a subprocess

2020-11-11 Thread Sean McAfee
I posted this question on Stack Overflow a few days ago: https://stackoverflow.com/questions/64757138/raku-sending-a-string-to-a-subprocesss-standard-input ...but there haven't been any answers, so I'm asking here. The tl;dr is that I don't see an obvious way to send data to a subprocess's standa

Re: Sending a string to a subprocess

2020-11-11 Thread Paul Procacci
https://docs.raku.org/type/Proc my $p = run "cat", "cat - > outfile", :in, :out; $p.in.say: "Hello,\nworld!"; On Wed, Nov 11, 2020 at 7:15 PM Sean McAfee wrote: > I posted this question on Stack Overflow a few days ago: > https://stackoverflow.com/questions/64757138/raku-sending-a-string-to-a-

Re: Sending a string to a subprocess

2020-11-11 Thread Paul Procacci
So sorry... hit enter way too early. https://docs.raku.org/type/Proc my $p = run "ssh", "myhost", "cat - > outfile", :in, :out; $p.in.say: "Hello,\nworld!"; I haven't tested it, but you can obtain a proc object and write to the processes' stdin directly. ~Paul On Wed, Nov 11, 2020 at 7:41 PM

Re: Sending a string to a subprocess

2020-11-11 Thread Sean McAfee
On Wed, Nov 11, 2020 at 4:44 PM Paul Procacci wrote: > So sorry... hit enter way too early. > > https://docs.raku.org/type/Proc > > my $p = run "ssh", "myhost", "cat - > outfile", :in, :out; > $p.in.say: "Hello,\nworld!"; > > Ah, of course. It's so obvious now. Thanks!