[CS-FSLUG] Sed and other tools

Ed Hurst ehurst at soulkiln.org
Thu Jul 7 21:10:44 CDT 2011


I assume sed is not necessarily the proper tool for this task, or
perhaps not the whole task. After re-reading the most recent discussion
on sed, I was hoping to accomplish something a bit more complicated for
a similar context.

On my site, I typically include on each page a header meta line which
identifies who produced the file. I chose the term "formator" because I
don't own the content of all the files, but I do have permission to use
it. At any rate, it prevents spamming while permitting some folks to
contact me. Each of these has a deconstructed email address which is no
longer valid "somebody at such dot com". The problem with using sed is
the lines are broken, so that the input pattern has a newline break in
it:

   <meta name="formator" content="Ed Hurst - softedges at softhome dot
   net" />

That's a literal paste. It's not necessary to keep the line break, but I
need to replace the whole address with 'eddie at soulkiln dot org'. I
estimate there are over a hundred files in the archive in several
different directories and subdirectories. Not all of them have this old
address; some have yet another invalid address.

After reading the manpage and some tutorials, I don't quite get how to
persuade sed to read past the newline. The examples I've found are all
far more complex than I need. I may someday learn those things, but
right now is not the best time to take an extended course in sed.

Ed Hurst
--------
Open for Business - http://ofb.biz/
Kiln of the Soul - http://soulkiln.org/
blog - http://soulkiln.myopera.com/




More information about the Christiansource mailing list