From owner-freebsd-questions@FreeBSD.ORG Mon Dec 25 05:04:33 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 15DDC16A403 for ; Mon, 25 Dec 2006 05:04:33 +0000 (UTC) (envelope-from parv@pair.com) Received: from mta1.adelphia.net (mta1.adelphia.net [68.168.78.175]) by mx1.freebsd.org (Postfix) with ESMTP id CF33E13C47A for ; Mon, 25 Dec 2006 05:04:32 +0000 (UTC) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([69.160.66.115]) by mta15.adelphia.net (InterMail vM.6.01.05.04 201-2131-123-105-20051025) with ESMTP id <20061225045301.ENEH25578.mta15.adelphia.net@default.chvlva.adelphia.net>; Sun, 24 Dec 2006 23:53:01 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id 20476B5AF; Mon, 25 Dec 2006 00:04:48 -0500 (EST) Date: Mon, 25 Dec 2006 00:04:47 -0500 From: Parv To: DeepTech Message-ID: <20061225050447.GB4228@holestein.holy.cow> Mail-Followup-To: DeepTech , freebsd-questions@freebsd.org References: <458DFE11.1040201@hotpop.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <458DFE11.1040201@hotpop.com> Cc: freebsd-questions@freebsd.org Subject: OT: sed usage (was 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: Mon, 25 Dec 2006 05:04:33 -0000 in message <458DFE11.1040201@hotpop.com>, wrote DeepTech thusly... > > sed -e 's/http\:\/\/www\.domain\.htm\///g' *.htm > *.htm That will most likely destroy the original file(s). Depending on your shell, you will get redirection error from the shell if there happen to be more than one file matching the pattern '*.htm'. In particular, in zsh 4.2.6 ... # cat p polka dot # cp -f p q; cp -f p qq # ls -l p q* -rw------- 1 parv people 10 Dec 24 23:32 p -rw------- 1 parv people 10 Dec 24 23:32 q -rw------- 1 parv people 10 Dec 24 23:32 qq # sed -e '' q* >| q* # ls -l q* -rw------- 1 parv people 0 Dec 24 23:34 q -rw------- 1 parv people 0 Dec 24 23:34 qq > NOTE: not sure if u have to use a '\' before that ':' No, ':' need not be escaped. - Parv --