From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: References: <526FE8DB.5040709@gmx.de> <52727C23.8070302@gmx.de> Date: Wed, 6 Nov 2013 21:42:34 +0100 Message-ID: From: Mark van Atten To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: Re: [9fans] acme/sam language question Topicbox-Message-UUID: 89ee81fc-ead8-11e9-9d60-3106f5b1d025 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 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. >>> >>> 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 <[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 <[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 >