9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] acme/sam language question
@ 2013-10-29 15:31 Rudolf Sykora
  2013-10-29 16:56 ` Friedrich Psiorz
  0 siblings, 1 reply; 11+ messages in thread
From: Rudolf Sykora @ 2013-10-29 15:31 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2013-11-21 14:52 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-29 15:31 [9fans] acme/sam language question 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
2013-11-21 13:28               ` Rudolf Sykora
2013-11-21 14:52                 ` Mark van Atten

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).