Date: Tue, 23 Oct 2007 12:44:58 -0700 From: Gary Kline <kline@tao.thought.org> To: "Benjamin M. A'Lee" <bma+lists@subvert.org.uk> Cc: freebsd-questions@freebsd.org Subject: Re: help in deletion part of a line Message-ID: <20071023194458.GA15742@thought.org> In-Reply-To: <20071023023713.GC9711@gilmour.subvert.org.uk> References: <20071022224140.GA7786@thought.org> <20071023023713.GC9711@gilmour.subvert.org.uk>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <bma@subvert.org.uk> > 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071023194458.GA15742>