Date: Tue, 23 Oct 2007 12:49:58 -0700 From: Gary Kline <kline@tao.thought.org> To: Shantanoo Mahajan <shantanoo@gmail.com> Cc: Gary Kline <kline@tao.thought.org>, FreeBSD Mailing List <freebsd-questions@FreeBSD.ORG> Subject: Re: help in deletion part of a line Message-ID: <20071023194958.GB15742@thought.org> In-Reply-To: <B0D49A56-F876-4A44-83E9-F3635A1515A7@gmail.com> References: <20071022224140.GA7786@thought.org> <B0D49A56-F876-4A44-83E9-F3635A1515A7@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071023194958.GB15742>
