Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Dec 2006 01:42:42 -0500
From:      Randy Pratt <bsd-unix@earthlink.net>
To:        "Jack Stone" <antennex@hotmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Search & Replace Issue
Message-ID:  <20061224014242.55b3cbe3.bsd-unix@earthlink.net>
In-Reply-To: <BAY125-F30049BC3F42C8F2E17BA61CCC30@phx.gbl>
References:  <BAY125-F30049BC3F42C8F2E17BA61CCC30@phx.gbl>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On Sat, 23 Dec 2006 21:29:40 -0600
"Jack Stone" <antennex@hotmail.com> wrote:

> Appreciate a tip on how to search & replace  hundreds of *.htm files:
> 
> >From this:
> <li><a href="http://www.domain.com/tales/wouf.html
> To this:
> <li><a href="tales/wouf.html
> 
> In other words, I just want the relative path and remove all the extra:
> http://www.domain.htm/  portions of the lines.

Probably many ways to do this but I typically use sed to edit
files in-place:

	sed -i "" 's/http:\/\/www.domain.com\///g' *.htm

Randy
-- 



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?20061224014242.55b3cbe3.bsd-unix>