9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "James A. Robinson" <jimr@highwire.stanford.edu>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] acme: send dot to the stdin of a more complicated command
Date: Wed, 28 Aug 2013 08:11:42 -0700	[thread overview]
Message-ID: <CAPd04b7QpcQ7PiwLpcako4WH85z5a=kEbGERp8ZdzXvsAO0zHg@mail.gmail.com> (raw)
In-Reply-To: <12528660.BEdGTc6QD4@coil>

[-- Attachment #1: Type: text/plain, Size: 831 bytes --]

On Wed, Aug 28, 2013 at 5:13 AM, dexen deVries <dexen.devries@gmail.com>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

[-- Attachment #2: Type: text/html, Size: 1667 bytes --]

      parent reply	other threads:[~2013-08-28 15:11 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-08 12:48 Rudolf Sykora
2009-06-08 16:04 ` Lyndon Nerenberg
2009-06-08 16:34   ` Rudolf Sykora
2009-06-08 16:58     ` andrey mirtchovski
2009-06-08 17:30       ` Rudolf Sykora
2009-06-08 17:35         ` andrey mirtchovski
2009-06-08 17:45           ` Rudolf Sykora
2009-06-08 17:42         ` yy
2009-06-08 18:15         ` Russ Cox
2009-06-08 18:35           ` Dan Cross
2009-06-08 18:59           ` [9fans] acme: send dot to the stdin of a more complicated Skip Tavakkolian
2009-06-09  8:28           ` [9fans] acme: send dot to the stdin of a more complicated command Rudolf Sykora
2013-08-28  8:05           ` Rudolf Sykora
2013-08-28 12:13             ` dexen deVries
2013-08-28 12:53               ` Rudolf Sykora
2013-08-28 15:11               ` James A. Robinson [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPd04b7QpcQ7PiwLpcako4WH85z5a=kEbGERp8ZdzXvsAO0zHg@mail.gmail.com' \
    --to=jimr@highwire.stanford.edu \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).