From owner-freebsd-questions@FreeBSD.ORG Tue Oct 23 19:45:13 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A5AB16A419 for ; Tue, 23 Oct 2007 19:45:13 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (dsl231-043-140.sea1.dsl.speakeasy.net [216.231.43.140]) by mx1.freebsd.org (Postfix) with ESMTP id 5327213C4A7 for ; Tue, 23 Oct 2007 19:45:13 +0000 (UTC) (envelope-from kline@tao.thought.org) Received: from tao.thought.org (localhost [127.0.0.1]) by tao.thought.org (8.13.8/8.13.1) with ESMTP id l9NJj0oa016292; Tue, 23 Oct 2007 12:45:00 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.8/8.13.1/Submit) id l9NJiwjR016288; Tue, 23 Oct 2007 12:44:59 -0700 (PDT) (envelope-from kline) Date: Tue, 23 Oct 2007 12:44:58 -0700 From: Gary Kline To: "Benjamin M. A'Lee" Message-ID: <20071023194458.GA15742@thought.org> References: <20071022224140.GA7786@thought.org> <20071023023713.GC9711@gilmour.subvert.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071023023713.GC9711@gilmour.subvert.org.uk> User-Agent: Mutt/1.4.2.2i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 21 of service to the Unix community. Cc: freebsd-questions@freebsd.org Subject: Re: help in deletion part of a line 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, 23 Oct 2007 19:45:13 -0000 On Tue, Oct 23, 2007 at 03:37:13AM +0100, Benjamin M. A'Lee wrote: > On Mon, Oct 22, 2007 at 03:41:40PM -0700, Gary Kline wrote: > > > > Is there an easier way by sed or ed to remove strings > > (caight by grep) of the sort: > > > > part5.chapter2.text- > > > > where "5" and "2" can be any integer below 10? > > > > (I know how to delete the *entire* line using ed, but not just > > the first part? > > gilmour% echo testpart5.chapter2.text-test | sed 's/part[0-9].chapter[0-9]\.text-//g' > testtest > > Modify as necessary. > Thanks. I was able to get rid of things likie -567-[text] from ^, but the part[1-5]. --- OH::: I didn't escape the "." Duh::: hit myself in the forehead! ... slinking away... . gary > -- > Benjamin A'Lee > http://subvert.org.uk/~bma/ > "The right to search for truth implies also a duty; one must not conceal > any part of what one has recognized to be true." - Albert Einstein -- Gary Kline kline@thought.org www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org