How to do "Edit ,s/foo/bar/g" using 9p

36 views
Skip to first unread message

vbnut

unread,
Jan 27, 2021, 3:17:52 PM1/27/21
to plan9port-dev
Is there any way to write a shell script that uses 9p(1) and  and acme(4) to do the equivalent of "Edit ,s/foo/bar/g" to an acme window?

Thanks.

Jacob Vosmaer

unread,
Jan 27, 2021, 3:27:52 PM1/27/21
to t6p0...@sneakemail.com, plan9port-dev
Not the same thing, but you could grab the window contents with 9p read, run it through sam, and put the result back in.

Op wo 27 jan. 2021 om 21:17 schreef vbnut <t6p0...@sneakemail.com>:
Is there any way to write a shell script that uses 9p(1) and  and acme(4) to do the equivalent of "Edit ,s/foo/bar/g" to an acme window?

Thanks.

--

---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plan9port-dev/8ec1e53a-c96c-4cf4-a5f6-5cfbcceb3cf7n%40googlegroups.com.

vbnut

unread,
Jan 27, 2021, 4:06:45 PM1/27/21
to plan9port-dev
Interesting!  I hadn't thought of using sam (or ssam or awk for that matter).  Its a possible workaround, but, I was hoping there was a way to get acme to do the work.

Martin Kühl

unread,
Jan 28, 2021, 2:12:40 AM1/28/21
to t6p0...@sneakemail.com, plan9port-dev
If you're really sure you want to do that you could do something like
https://github.com/mkhl/cmd/blob/master/acme/acmeeval/main.go: add the
command to the window's tag and synthesize a button 2 event for the
command text.

On Wed, 27 Jan 2021 at 22:06, vbnut <t6p0...@sneakemail.com> wrote:
>
> Interesting! I hadn't thought of using sam (or ssam or awk for that matter). Its a possible workaround, but, I was hoping there was a way to get acme to do the work.
>
>> Not the same thing, but you could grab the window contents with 9p read, run it through sam, and put the result back in.
>>
> --
>
> ---
> You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/plan9port-dev/83870ea4-939a-4666-8d5f-cd4874da66ecn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages