From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v1283) From: Micah Stetson In-Reply-To: Date: Wed, 6 Nov 2013 12:26:24 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <7338C1A3-C0B1-488B-9EDA-AD24CF176159@classroomsystems.com> References: <526FE8DB.5040709@gmx.de> <52727C23.8070302@gmx.de> To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Subject: Re: [9fans] acme/sam language question Topicbox-Message-UUID: 89e5c440-ead8-11e9-9d60-3106f5b1d025 What if you specify the address twice like this: /A/+#0;/B/-#0g/CC/ s/CC/DD/g /A/+#0;/B/-#0p That doesn't work if A and B occur more than once in the file or if DD = matches A or B. But otherwise, it seems to work for me. Micah On Nov 6, 2013, at 10:47 AM, Rudolf Sykora wrote: > On 31 October 2013 20:24, Rudolf Sykora = wrote: >> On 31 October 2013 16:49, Friedrich Psiorz wrote: >>> It works for me, but I found another inconsistency. >>>=20 >>> I tried it on p9p and 9vx, both in acme and sam. >>=20 >>>>>> /A/+#0;/B/-#0 >>>>>> g/CC/ s/CC/DD/g >>>>>> p >>=20 >> 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: >>=20 >> sam -d <[2] /dev/null >> /A/+#0;/B/-#0 >> g/CC/ s/CC/DD/g >> p >> EOF >>=20 >> 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 >>=20 >> sam -d <[2] /dev/null >> /A/+#0;/B/-#0 g/CC/ s/CC/DD/g >> p >> EOF >>=20 >> 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. :) >>=20 >> Thanks >> Ruda >=20 > So far I still do not know how to do it properly... > But it seems nobody here proposes anything... >=20 > Thanks for any clue > Ruda >=20