Date: Tue, 27 Dec 2005 21:32:49 +0600 From: Dmitry Sidorov <dsidorov@swsoft.com> To: Jack Stone <antennex@hotmail.com> Cc: freebsd-questions@freebsd.org Subject: Re: a SED need Message-ID: <1135697569.835.4.camel@sidorov.plesk.ru> In-Reply-To: <BAY106-F1673797A89767CF16F02ECC370@phx.gbl> References: <BAY106-F1673797A89767CF16F02ECC370@phx.gbl>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 2005-12-27 at 09:18 -0600, Jack Stone wrote: > I have some HTML files with hundreds of URLs that I need to modify using a > search/replace string. I assume that SED(1) is the right tool to use, but > every syntax I've tried has not worked. > > Here is what I'm trying to do: > Change full URLs to relative paths, in other words, chop off the > "http://www.example.com/" portion: > > >From this: > <li><a href="http://www.example.com/model/many.html"> > To this: > <li><a href="model/many.html"> > > I think it is the slashes and quotes that are giving me fits as I'm very > much a novice on SED(1) syntax. > > Would appreciate any tips on how to do the above so I can search and replace > all of the hundreds of URLs. > > Many thanks and Happy New Year! > > Regards, > Jack > > _________________________________________________________________ > Dont just search. Find. Check out the new MSN Search! > http://search.msn.click-url.com/go/onm00200636ave/direct/01/ > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org" Try this: sed s/http:\\/\\/www.example.com// your_file -- Dmitry Sidorov PEM QA Engineer SWsoft, Inc. E-mail: dsidorov@swsoft.com ICQ UIN: 864582
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1135697569.835.4.camel>