From owner-freebsd-questions@FreeBSD.ORG Sun Dec 24 07:17:13 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD8FA16A407 for ; Sun, 24 Dec 2006 07:17:13 +0000 (UTC) (envelope-from bsd-unix@earthlink.net) Received: from fall-lakeland.atl.sa.earthlink.net (fall-lakeland.atl.sa.earthlink.net [207.69.195.103]) by mx1.freebsd.org (Postfix) with ESMTP id 958CF13C46D for ; Sun, 24 Dec 2006 07:17:13 +0000 (UTC) (envelope-from bsd-unix@earthlink.net) Received: from pop-tawny.atl.sa.earthlink.net ([207.69.195.67]) by fall-lakeland.atl.sa.earthlink.net with esmtp (Exim 4.34) id 1GyN4L-0004gw-Fj for freebsd-questions@freebsd.org; Sun, 24 Dec 2006 01:42:49 -0500 Received: from fl-71-54-28-212.dhcp.embarqhsd.net ([71.54.28.212] helo=kt.weeeble.com) by pop-tawny.atl.sa.earthlink.net with smtp (Exim 3.36 #1) id 1GyN4J-0005qc-00; Sun, 24 Dec 2006 01:42:47 -0500 Date: Sun, 24 Dec 2006 01:42:42 -0500 From: Randy Pratt To: "Jack Stone" Message-Id: <20061224014242.55b3cbe3.bsd-unix@earthlink.net> In-Reply-To: References: X-Mailer: Sylpheed version 2.2.10 (GTK+ 2.10.6; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org Subject: Re: Search & Replace Issue 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: Sun, 24 Dec 2006 07:17:13 -0000 On Sat, 23 Dec 2006 21:29:40 -0600 "Jack Stone" wrote: > Appreciate a tip on how to search & replace hundreds of *.htm files: > > >From this: >
  • > 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 --