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: "Eric Sandall" <sandalle AT hellhound.homeip.net>
  • To: <sm-sorcery AT lists.ibiblio.org>
  • Subject: Re: [SM-Sorcery]questions about advanced file manipulation with bash/unix tools.
  • Date: Tue, 30 Jul 2002 21:28:24 -0700 (PDT)

Nicholas K. Jennings said:
> 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.
>
> --
> Nicholas K. Jennings | nkj AT namodn.com
> SourceMage GNU/Linux | www.sourcemage.org
> Sorcery Team |

I don't really know how to do most of this, but I got some help with
Abiword, as this searches for a certain section in /etc/X11/XF86Config*
and then adds a line.

Other good examples are the kernel spells done by Chris. These may be
fairly slow for what you want and not work very well, but they add lines
at a certain point as well and make sure that the added lines are not
duplicates.

-One of Three

--
Eric Sandall | Source Mage GNU/Linux Developer
sandalle AT hellhound.homeip.net | http://www.sourcemage.org
http://hellhound.homeip.net/~sandalle | SystAdmin @ Inst. Shock Physics @ WSU
ICQ: 667348 | http://www.shock.wsu.edu/






Archive powered by MHonArc 2.6.24.

Top of Page