From: Mark van Atten <vanattenmark@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] acme/sam language question
Date: Wed, 6 Nov 2013 21:42:34 +0100 [thread overview]
Message-ID: <CALAsyW0MGeGG2=hOkGjrC9Z2c4oc1us1ux4z9WMWPNtbVefjKw@mail.gmail.com> (raw)
In-Reply-To: <CAOEdRO1qX2UfF91TS9nN4aR3RAwHgrJ5BbHo_zG1_hAENoApMg@mail.gmail.com>
I write the script like this:
/A/+#0;/B/-#0 {
g/CC/ s/CC/DD/g
}
p
Mark.
On Wed, Nov 6, 2013 at 7:47 PM, Rudolf Sykora <rudolf.sykora@gmail.com> wrote:
> On 31 October 2013 20:24, Rudolf Sykora <rudolf.sykora@gmail.com> wrote:
>> On 31 October 2013 16:49, Friedrich Psiorz <f.psiorz@gmx.de> wrote:
>>> It works for me, but I found another inconsistency.
>>>
>>> I tried it on p9p and 9vx, both in acme and sam.
>>
>>>>>> /A/+#0;/B/-#0
>>>>>> g/CC/ s/CC/DD/g
>>>>>> p
>>
>> Well. If I use these commands one by one inside p9p acme
>> (and probably sam, too), I truly get what I want (and what
>> you say). The problem appears when I want to run it from
>> a script like this:
>>
>> sam -d <<EOF $1 >[2] /dev/null
>> /A/+#0;/B/-#0
>> g/CC/ s/CC/DD/g
>> p
>> EOF
>>
>> then you get, since the g is on a seperate line, an extra
>> output from the line before g. And if you try to join g with
>> the match like
>>
>> sam -d <<EOF $1 >[2] /dev/null
>> /A/+#0;/B/-#0 g/CC/ s/CC/DD/g
>> p
>> EOF
>>
>> then you get no output if CC is not between A and B
>> (although when it is there, you get what I want).
>> In neither case I am fully satisfied. :)
>>
>> Thanks
>> Ruda
>
> So far I still do not know how to do it properly...
> But it seems nobody here proposes anything...
>
> Thanks for any clue
> Ruda
>
next prev parent reply other threads:[~2013-11-06 20:42 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 15:31 Rudolf Sykora
2013-10-29 16:56 ` Friedrich Psiorz
2013-10-30 7:47 ` Rudolf Sykora
2013-10-31 15:21 ` Rudolf Sykora
2013-10-31 15:49 ` Friedrich Psiorz
2013-10-31 19:24 ` Rudolf Sykora
2013-11-06 18:47 ` Rudolf Sykora
2013-11-06 20:26 ` Micah Stetson
2013-11-06 20:42 ` Mark van Atten [this message]
2013-11-21 13:28 ` Rudolf Sykora
2013-11-21 14:52 ` Mark van Atten
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='CALAsyW0MGeGG2=hOkGjrC9Z2c4oc1us1ux4z9WMWPNtbVefjKw@mail.gmail.com' \
--to=vanattenmark@gmail.com \
--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).