From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 Date: Tue, 29 Oct 2013 16:31:26 +0100 Message-ID: From: Rudolf Sykora To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=UTF-8 Subject: [9fans] acme/sam language question Topicbox-Message-UUID: 889515be-ead8-11e9-9d60-3106f5b1d025 Hello, how can I set a dot from after A to before B, then make a global substitution, within thus set dot, of CC to DD and print the resulting text? I.e., if there isn't any CC between A and B, just print what's between A and B, if there is, change it to DD and print all between A and B. I have sth like this /A/+#0;/B/-#0 s/CC/DD/g p which works if there *is* the CC, but not if it is not there; then the s command just resets the dot to an empty set. Thank you Ruda