From owner-freebsd-questions@FreeBSD.ORG Tue Oct 23 19:50:07 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 8EC6816A417 for ; Tue, 23 Oct 2007 19:50:07 +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 4A70013C4B5 for ; Tue, 23 Oct 2007 19:50:06 +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 l9NJnxsS016317; Tue, 23 Oct 2007 12:49:59 -0700 (PDT) (envelope-from kline@tao.thought.org) Received: (from kline@localhost) by tao.thought.org (8.13.8/8.13.1/Submit) id l9NJnxkG016316; Tue, 23 Oct 2007 12:49:59 -0700 (PDT) (envelope-from kline) Date: Tue, 23 Oct 2007 12:49:58 -0700 From: Gary Kline To: Shantanoo Mahajan Message-ID: <20071023194958.GB15742@thought.org> References: <20071022224140.GA7786@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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: Gary Kline , FreeBSD Mailing List 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:50:07 -0000 On Tue, Oct 23, 2007 at 08:13:49AM +0530, Shantanoo Mahajan wrote: > On 23-Oct-07, at 4:11 AM, 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? > > $ echo 'part5.chapter2.text-' | tr -d '[0-9]' > part.chapter.text- > > $ echo 'part5.chapter2.text-' | sed 's/[0-9]//g' > part.chapter.text- > This would help unify my regex since I have "part7.chapter4.text" as well as misc other shtuff. (I like tr ... it's easy and has many uses... .) thanks. gary > > regards, > shantanoo > -- Gary Kline kline@thought.org www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org