[geeks] search and replace

Kevin kevin at mpcf.com
Fri Sep 5 13:53:53 CDT 2003


Daniel Johannsson sent me the following script: which
worked just fine:

sh
for i in `ls *html`
do
cat $i | sed -e 's/pic.gif/images\/pic.gif/g' >
tmp.html
cp tmp.html $i
done

(thanks Daniel)

More importantly i now know what tool is commonly used
for text operation such as this and will refer to it
(and it's man pages) in the future.

Thanks all,
/KRM

On Fri, 5 Sep 2003 13:27:26 -0500
"Joshua D. Boyd" <jdboyd at celestrion.celestrion.net>
wrote:

> On Fri, Sep 05, 2003 at 02:04:47PM -0400, Kurt Huhn
> wrote:
> 
> > sed s/pic.gif/"images/pic.gif"/g
> > will probably get you there.  Unless I've typo'd
> > something, that is....
> 
> That takes care of one file you still have to apply
> it to all of
> them._______________________________________________
> GEEKS:  http://www.sunhelp.org/mailman/listinfo/geeks


-- 
keyserver: http://pgp.mit.edu/



More information about the geeks mailing list