[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A little sed



On Fri, Jan 26, 2001 at 11:19:53AM +0100, Hans wrote:

> - I need to clean up a bunch of html files from <SCRIPT>
> </SCRIPT> tags. I tried sed -e s/\<SCRIPT.*SCRIPT\>// file.html
> > file.html2, but it only deletes the first line, not the whole
> > script. The /m modifier doesn't seem to work. How do I go
> > about it.
>
> - Is it possible to overwrite the original file, not redirect
> to an alterate file? 
>
> - How do I process a bunch of files at once? sed -e s/foo/bar/
> *.html > *html2 doesn't seem to do it. Or need it be something
> like for $i in * do....? I can't seem to get this to work
> either.

Hi,

You could use the shell scripts 'overwrite' and 'replace' in
Kernighan and Pike, The UNIX programming environment, Chapter 5,
Section 5.5, pages 154-155.

Best,
Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | Another year is gone -
Harish-Chandra Research Institute   | A travel hat on my head,
        GnuPG public key at:        | Straw sandals on my feet.
http://riemann.mri.ernet.in/~raghu/ |          -- Matsuo Basho



Reply to: