From owner-freebsd-questions@FreeBSD.ORG Tue Dec 27 15:18:57 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9CA6716A41F for ; Tue, 27 Dec 2005 15:18:57 +0000 (GMT) (envelope-from antennex@hotmail.com) Received: from hotmail.com (bay106-f1.bay106.hotmail.com [65.54.161.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 65AAC43D5F for ; Tue, 27 Dec 2005 15:18:57 +0000 (GMT) (envelope-from antennex@hotmail.com) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Tue, 27 Dec 2005 07:18:57 -0800 Message-ID: Received: from 65.54.161.200 by by106fd.bay106.hotmail.msn.com with HTTP; Tue, 27 Dec 2005 15:18:56 GMT X-Originating-IP: [65.68.247.73] X-Originating-Email: [antennex@hotmail.com] X-Sender: antennex@hotmail.com From: "Jack Stone" To: freebsd-questions@freebsd.org Date: Tue, 27 Dec 2005 09:18:56 -0600 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 27 Dec 2005 15:18:57.0139 (UTC) FILETIME=[DB243C30:01C60AF8] Subject: a SED need X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2005 15:18:57 -0000 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:
  • To this:
  • 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 _________________________________________________________________ Don’t just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/