Skip to Content.
Sympa Menu

sm-sorcery - Re: [SM-Sorcery]questions about advanced file manipulation with bash/unix tools.

sm-sorcery AT lists.ibiblio.org

Subject: Discussion of Sorcery related topics

List archive

Chronological Thread  
  • From: nealbirch <nealbirch AT attbi.com>
  • To: Dufflebunk <dufflebunk AT dufflebunk.homeip.net>
  • Cc: "Nicholas K. Jennings" <nkj AT namodn.com>, sm-sorcery AT lists.ibiblio.org
  • Subject: Re: [SM-Sorcery]questions about advanced file manipulation with bash/unix tools.
  • Date: Wed, 31 Jul 2002 17:30:58 -0400

Dufflebunk wrote:
The main tools for doing search and replacement are sed and awk. I've
yet to figure out how to do n-line regexps in them without changing the
IFS environment variable though. You might find some inspiration in some of my scripts... grimoireToDot
or the distrowatch one particularly use a lot of it...
What I'd like to do is, edit a file, search for a section in that
file, remove the whole section (several lines), which means being
able to determin when the section starts, and ends (character
recognition/regexp?). Then replace that section (in the same
location) with generated content that I would have already
generated to replace it.

What tools would be needed to go about doing this? Any pointers,
tips, examples etc. would be greatly appreciated.

The O'Reilly book "Sed & Awk" has an extensive discussion on regexp which might be of use to you. It's kinda of expensive but worth it. I've been reading it the last week or so, along with the one they did on "Learning the Bash Shell" and etc. (I should get there stock, as many as I own...)

--
"You can fool some of the people all of the time
--and those are the ones you have to concentrate on!"
GW Bush-- from the N.Y. Times





Archive powered by MHonArc 2.6.24.

Top of Page