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, |