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: "Sergey A. Lipnevich" <sergeyli AT pisem.net>
  • To: nealbirch <nealbirch AT attbi.com>
  • 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: Sat, 03 Aug 2002 12:01:03 -0400

Taking a look at the larger problem, I would wait until everyone uses XML as their configuration file format, so knowing the structure of the file is a 0 steps learning curve and making changes to it it as easy as manipulating a node. Zero custom parsing. Automatic syntax checking and validation. Ahh, the fairy land...

nealbirch wrote:

Nicholas K. Jennings wrote:

Hi all,

I have some questions about how to go about doing some advanced file
editing with bash script and the standard unix tools. Everytime I
think about how to go about things I get caught up in the perl way
to do 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.


Get some good books on Bash and regexp if you can. I have the O'Reilly books "Learning Bash" and "sed&awk"; they have one on regexp too, but I havent' sprung the money for that yet. sed&awk have a good explanation on how to use regexp and since you will be using sed&awk a lot, it's worth the expense. Having a good foundation in perl is going to help I think, I am coming to this cold and have to look at the references a lot.







Archive powered by MHonArc 2.6.24.

Top of Page