From: Rudolf Sykora <rudolf.sykora@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: [9fans] acme/sam language question
Date: Tue, 29 Oct 2013 16:31:26 +0100 [thread overview]
Message-ID: <CAOEdRO1XQmHP0DpMKK_t6svkdwY=3pnX-bmsJc6Uk1eKxzW+yg@mail.gmail.com> (raw)
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
next reply other threads:[~2013-10-29 15:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-29 15:31 Rudolf Sykora [this message]
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
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='CAOEdRO1XQmHP0DpMKK_t6svkdwY=3pnX-bmsJc6Uk1eKxzW+yg@mail.gmail.com' \
--to=rudolf.sykora@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).