Dave Neary writes,
I was reading the Sed question to the list in the archives (sorry, still
not re-subscribed :) and Padraig's answer, which is no good...
John A. Kinsella wrote:
> I'd like to do a simple conversion
> s/Maple 8/Maple 9/g
> in a bunch of Maple *.mws files using sed.
> Is there a way to tell sed to do the substitution while preserving the
> line breaks (which Maple seems to need).
I take the "line breaks" to be possible newlines between "Maple" and "8".
So, unless I mis-understand, surely this is what's required?
# simple case
s/Maple 8/Maple 9/g
# line break (with optional spaces)
(If you have newlines within the word "maple", it's a pain but stil doable
by extending this technique).
Paul Dunne | paul at dunne.ie.eu.org | http://dunne.yi.org/
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!