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: "Nicholas K. Jennings" <nkj AT namodn.com>
  • Cc: sm-sorcery AT lists.ibiblio.org
  • Subject: Re: [SM-Sorcery]questions about advanced file manipulation with bash/unix tools.
  • Date: Sat, 03 Aug 2002 07:36:21 -0400

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.

web links:
http://www.rtfiber.com.tw/~changyj/sed/
http://www.tldp.org/LDP/abs/html/index.html
http://spazioinwind.libero.it/seders/
http://www.caliban.org/bash/
http://www-personal.umich.edu/~jlawler/routledge/sedawkperl.html

Use google or yahoo search for particular problems; someone somewhere has done it already, probably.

Neal

--
"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