Gentoo Archives: gentoo-user

From: Pandu Poluan <pandu@××××××.info>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] sed/awk question
Date: Tue, 22 Nov 2011 03:05:52
Message-Id: CAA2qdGWbQb+dU3ZEK4+yUbZ9P=mVfopC-BhbyKO-+bmyz9AnhA@mail.gmail.com
In Reply to: Re: [gentoo-user] sed/awk question by Pandu Poluan
1 On Nov 22, 2011 10:01 AM, "Pandu Poluan" <pandu@××××××.info> wrote:
2 >
3 >
4 > On Nov 22, 2011 9:57 AM, "Adam Carter" <adamcarter3@×××××.com> wrote:
5 > >
6 > > Hi All,
7 > >
8 > > I need to cut a string, which happens to be a filename, using the
9 > > first dash that's followed by a numeral, so cut -f 1 -d"-" fails if
10 > > the filename has an extra dash. How do i do this?
11 > >
12 >
13 > sed -r -e 's/(.*)-[0-9].*/\1/'
14
15 You know, that looks familiar... are you trying to get a package name from
16 the list of eix-installed? :-)
17
18 Rgds,

Replies

Subject Author
Re: [gentoo-user] sed/awk question Adam Carter <adamcarter3@×××××.com>