[plug] multi-file find & replace

Shackleton, Kevin kshackleton at agric.wa.gov.au
Fri Oct 23 16:36:11 WST 1998


Thanks Bevan - did you really knock that out in so short a time.

It seems to have done the trick.  I'd better find out what happened in
that syntax.

BTW there is the "Linux Apache SSL PHP/FI frontpage mini-HOWTO" I've
discovered.  I'm just trying to find out about the frontpage extensions
to Linux - sounds at first like a bit of code that crashes the daemon
with a GPF every quarter hour, but I guess it must be more useful than
that.

K.

> ----------
> From: 	Bevan Broun[SMTP:bevanb at ee.uwa.edu.au]
> Reply To: 	plug at linux.org.au
> Sent: 	Friday, 23 October 1998 15:57
> To: 	plug at linux.org.au
> Subject: 	Re: [plug] multi-file find & replace
> 
> on Fri, Oct 23, 1998 at 03:56:53PM +0800, Shackleton, Kevin
> <kshackleton at agric.wa.gov.au> wrote:
> > I have a web site (done in frontpage) that refers to everything as
> > ".htm".  Apache seems to prefer ".html".  How can I quickly find all
> > occurrences in all files of '.htm"' and change them to '.html"'?
> Some
> > combination of shell and sed I suppose . .
> 
> Change to the top of the directory tree that you want to change. If
> you
> are using a bourne shell (/bin/sh for example) do:
> 
> for f in `find . -name '*.htm' -print`;do
> >g=`echo $f | sed -e 's/$/l/'`
> >cp $f $g
> >done
> 
> But there are many ways to do it.
> 
> BB
> -- 
> Bevan Broun                                           ph (08) 9380
> 1587
> Computer Systems Officer                             fax (08) 9380
> 1065
> Dept. Electrical and Electronic Engineering      
> University of Western Australia                                 rm.
> G70
> 


More information about the plug mailing list