From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <12528660.BEdGTc6QD4@coil> References: <12528660.BEdGTc6QD4@coil> From: "James A. Robinson" Date: Wed, 28 Aug 2013 08:11:42 -0700 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=089e013d202a99cd8604e5036aae Subject: Re: [9fans] acme: send dot to the stdin of a more complicated command Topicbox-Message-UUID: 759317f4-ead8-11e9-9d60-3106f5b1d025 --089e013d202a99cd8604e5036aae Content-Type: text/plain; charset=UTF-8 On Wed, Aug 28, 2013 at 5:13 AM, dexen deVries wrote: > your selection lacks the final LF to make Rc happy ;-) > > a quick and dirty hack would be to always append LF: > exec /usr/local/plan9/bin/rc <{9p read acme/$id/rdsel;echo;} > > tested with: > echo foo bar > rc <{9p read acme/$winid/rdsel; echo; } > > selecting bare `echo foo bar' (without LF) gives syntax error; selecting > whole > line works a-OK > A small variation of this would be to allow for multiple arguments to Run, following the label, and to shift the label off the args and pass the rest to the executing command. For my own copy of this I read the contents of rdsel into a separate file and execute it with any following args (I'm using sh, but I assume similar functionality is available in rc). Jim --089e013d202a99cd8604e5036aae Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Wed, Aug 28, 2013 at 5:13 AM= , dexen deVries <dexen.devries@gmail.com> wrote:
your selection l= acks the final LF to make Rc happy ;-)

a quick and dirty hack would be to always append LF:
exec /usr/local/plan9/bin/rc <{9p read acme/$id/rdsel;echo;}

tested with:
echo foo bar
rc <{9p read acme/$winid/rdsel; echo; }

selecting bare `echo foo bar' (without LF) gives syntax error; selectin= g whole
line works a-OK

A sm= all variation of this would be to allow for
multiple arguments to Run, following the label,
and to shift the label off the args and pass the
rest to the executing command.

For my own copy of this I read the contents<= /div>
of rdsel into a separate file and execute it
with any following args (I'm using sh, but= I
assume similar functionality is availabl= e in
rc).

<= div class=3D"gmail_extra">Jim

--089e013d202a99cd8604e5036aae--